Jeffreyxx01
Board Regular
- Joined
- Oct 23, 2017
- Messages
- 156
Hello guys,
I want to copy data from RawData into RawData2
Taking the data from RawData range A2:CF until it find lastrow ===> then copy this data into RawData2 from range A11
But before pasting the data into RawData2, I want to clear content from A11:CF until last row.
That is pretty much what I need.
Thanks for the help.
I want to copy data from RawData into RawData2
Taking the data from RawData range A2:CF until it find lastrow ===> then copy this data into RawData2 from range A11
But before pasting the data into RawData2, I want to clear content from A11:CF until last row.
That is pretty much what I need.
Thanks for the help.
Code:
Sub CopyData()
Dim iLastRow As Long
Dim LastRow As Long
With Worksheets("RawData2").Select
[COLOR=#ff0000]LastRow = .Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row[/COLOR]
Range("A11:CF" & LastRow).ClearContents
Sheets("RawData").Select
iLastRow = ActiveSheet.UsedRange.Rows.Count
Sheets("RawData").Range("A2:CF" & LastRow).Copy
End With
Sheets("RawData2").Range("A11").PasteSpecial xlPasteValues
Application.CutCopyMode = False
End Sub
Last edited: