Kerry Newman
New Member
- Joined
- Feb 23, 2018
- Messages
- 19
- Office Version
- 365
- 2019
- Platform
- Windows
In the attached picture the data in G11:J25 will change in rows deep when a slicer changes the data selection. Also the data in columns K,L,M which are VLOOKUPs, will change too.
I want to copy and paste only G11 to M25 (in this case) to cell T11. But my macro is copying G11:M39 (or further actually M20000).
When I select another option in the slicer, the list may be G11: M20. or maybe G11:M35....... I only want ROWS with data in column G,H,I or J but through column M my code is not doing this.....
Sub Macro3()
'
' Macro3 Macro
'
'
Range("H11:M20000" & Cells(Rows.Count, "C").End(xlUp).Row).Select
Selection.Copy
Range("T11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("T8").Select
End Sub
Any suggestions?
I want to copy and paste only G11 to M25 (in this case) to cell T11. But my macro is copying G11:M39 (or further actually M20000).
When I select another option in the slicer, the list may be G11: M20. or maybe G11:M35....... I only want ROWS with data in column G,H,I or J but through column M my code is not doing this.....
Sub Macro3()
'
' Macro3 Macro
'
'
Range("H11:M20000" & Cells(Rows.Count, "C").End(xlUp).Row).Select
Selection.Copy
Range("T11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("T8").Select
End Sub
Any suggestions?