Hi All,
I need to pull dynamic range, which can vary from B55:F55 to B55:F65, to "summary" sheet.
I need to omit some sheets since these are my working sheets. I have worked out following program but mot working. Please help me out.
I need to pull dynamic range, which can vary from B55:F55 to B55:F65, to "summary" sheet.
I need to omit some sheets since these are my working sheets. I have worked out following program but mot working. Please help me out.
Code:
Option Explicit
Sub summary()
Dim sht As Worksheet
Dim TargetCell As range 'cell just below last used cell in column C on sheet "SUMMARY"
Dim SourceRng As range 'range starting in C12 to last used cell in column C and including columns C to G
With Application
.ScreenUpdating = False
For Each sht In ActiveWorkbook.Worksheets
Select Case sht.Name
Case "Home", "GanttChart", "ProjectStatus", "ProjectPipeline", "PostLaunchSupport", "Summary", "WorkingSheet", "ProductMatrix", "ProjectTracker", "Template"
'Skip these sheets by doing nothing
Case Else
'can't get this part to work..
With sht
Set SourceRng = range("B55", range("B65536").End(xlUp).Offset(0, 4))
End With
Set TargetCell = ThisWorkbook.Sheets("Summary").Cells(Rows.Count, "E").End(xlUp).Offset(1, 0)
SourceRng.Copy TargetCell
End Select
Next sht
.CutCopyMode = False 'clear clipboard
.ScreenUpdating = True
End With
End Sub
Last edited by a moderator: