Glasgowsmile
Active Member
- Joined
- Apr 14, 2018
- Messages
- 280
- Office Version
- 365
- Platform
- Windows
Good Afternoon,
I've got the following code below and instead of doing A1:L500 on the Copy/Paste, I want it to look for the cell that has this "#############REPORT OUTPUT#############" and then copy every cell below it between Columns A:M
How would I go about that?
I've got the following code below and instead of doing A1:L500 on the Copy/Paste, I want it to look for the cell that has this "#############REPORT OUTPUT#############" and then copy every cell below it between Columns A:M
How would I go about that?
Code:
Sub DailyRatesWkday() Application.DisplayAlerts = False
Sheets("DlyRateCodes1").Range("A:M").Clear
Dim wkbCrntWorkBook As Workbook
Dim wkbSourceBook As Workbook
Set wkbCrntWorkBook = ActiveWorkbook
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "CSV Files", "*.csv"
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
Workbooks.Open .SelectedItems(1)
Set wkbSourceBook = ActiveWorkbook
ActiveSheet.Range("A1:L500").Copy
wkbCrntWorkBook.Sheets("DlyRateCodes1").Range("A1").PasteSpecial xlPasteValues
wkbSourceBook.Close False
End If
End With
Worksheets("Directions").Activate
End Sub