Oberon70
Board Regular
- Joined
- Jan 21, 2022
- Messages
- 160
- Office Version
- 365
- Platform
- Windows
Hi,
I am having problems with the below code, as I am trying to copy a range to another sheet.
I am having problems with the below code, as I am trying to copy a range to another sheet.
VBA Code:
Dim wb As Workbook
Dim wsData As Worksheet
Dim wsRcpt As Worksheet
Dim lRow As Long
Dim x As Integer
Dim rng As Variant
Dim InvID As Long
Sub Copy_Data_NM()
Set wb = ThisWorkbook
wb.Worksheets("Data").Visible = True
Set wsData = wb.Worksheets("Data")
'Set wsRcpt = wb.Worksheets("Receipted")
lRow = wsData.Cells(Rows.Count, 1).End(xlUp).Row
wb.Sheets.Add after:=wsData
ActiveSheet.Name = "Receipted"
'wb.Worksheets("Data").Visible = False
Set wsRcpt = wb.Worksheets("Receipted")
wsData.Range("C48:X" & lRow).Copy wb.Worksheets("Receipted")
ActiveSheet.Name = "Receipted"
End Sub