Forum Discussion
Rudrabhadra
Oct 26, 2022Brass Contributor
VBA for copying specific cells
Tried a VBA for copying specific cells from each worksheet and appending the data in one worksheet ("Comb") which is working as my requirement. But I understand that the code runs all the worksheet i...
- Oct 26, 2022
Sub Copydatamod() Dim Sh As Worksheet For Each Sh In ThisWorkbook.Worksheets Select Case Sh.Name Case Is = "Comb" Case Else Sh.Range("B7:EA46").Copy Sheets("Comb").Activate Range("B" & Rows.Count).End(xlUp).Rows.Cells.Offset(2, 0).Select ActiveSheet.Paste Application.CutCopyMode = False End Select Next Sh End Sub
Maybe with a SELECT CASE statement.
OliverScheurich
Oct 26, 2022Gold Contributor
Sub Copydatamod()
Dim Sh As Worksheet
For Each Sh In ThisWorkbook.Worksheets
Select Case Sh.Name
Case Is = "Comb"
Case Else
Sh.Range("B7:EA46").Copy
Sheets("Comb").Activate
Range("B" & Rows.Count).End(xlUp).Rows.Cells.Offset(2, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Select
Next Sh
End Sub
Maybe with a SELECT CASE statement.
- RudrabhadraOct 26, 2022Brass ContributorThanks it works perfectly.
Is it possible to combine row#11 and #12
Thanks in advance...- OliverScheurichOct 26, 2022Gold Contributor
You are welcome. Sorry i don't know if it's possible to combine rows 11 and 12.