ststern45
Well-known Member
- Joined
- Sep 17, 2005
- Messages
- 989
- Office Version
- 365
- 2010
- Platform
- Windows
The following code I am trying to copy a custom range of date from 1 workbook worksheet back to another workbook worksheet.
Pick3Drawings workbook worksheet PA3E (samename1) is where I am trying to copy the custom range of data to LM3Step1A workbook worksheet P3Draws.
Custom range is Cell A20 through E8953 (Note: this range will change each day)
Thank you in advance
Sub CopyPastep3Data()
Dim aRng As String, Sname1 As String
Dim bRng As String
Dim cRng As Integer
Dim dRng As Integer
Application.ScreenUpdating = False
Windows("LM3Step1A.xlsm").Activate
Sheets("P3Draws").Select
aRng = Sheets("P3Draws").Range("K2").Value 'Column A
bRng = Sheets("P3Draws").Range("O2").Value "Column E
cRng = Sheets("P3Draws").Range("B18").Value 'Cell value =20
dRng = Sheets("P3Draws").Range("B19").Value 'Cell value = 8953
Sname1 = Sheets("P3Draws").Range("B14").Value 'Worksheet name = PA3E
Windows("Pick3DRawings.xlsm").Activate
Sheets(Sname1).Select 'PA3E Worksheet
Range(aRng & Range(cRng).Value & ":" & bRng & Range(dRng).Value).Copy _ 'Cell range A20:E8953
' Code above is where I receive the error
Windows("LM3Step1A.xlsm").Activate
Sheets("P3Draws").Select
Range("K20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E2").Select
Application.ScreenUpdating = True
End Sub
Pick3Drawings workbook worksheet PA3E (samename1) is where I am trying to copy the custom range of data to LM3Step1A workbook worksheet P3Draws.
Custom range is Cell A20 through E8953 (Note: this range will change each day)
Thank you in advance
Sub CopyPastep3Data()
Dim aRng As String, Sname1 As String
Dim bRng As String
Dim cRng As Integer
Dim dRng As Integer
Application.ScreenUpdating = False
Windows("LM3Step1A.xlsm").Activate
Sheets("P3Draws").Select
aRng = Sheets("P3Draws").Range("K2").Value 'Column A
bRng = Sheets("P3Draws").Range("O2").Value "Column E
cRng = Sheets("P3Draws").Range("B18").Value 'Cell value =20
dRng = Sheets("P3Draws").Range("B19").Value 'Cell value = 8953
Sname1 = Sheets("P3Draws").Range("B14").Value 'Worksheet name = PA3E
Windows("Pick3DRawings.xlsm").Activate
Sheets(Sname1).Select 'PA3E Worksheet
Range(aRng & Range(cRng).Value & ":" & bRng & Range(dRng).Value).Copy _ 'Cell range A20:E8953
' Code above is where I receive the error
Windows("LM3Step1A.xlsm").Activate
Sheets("P3Draws").Select
Range("K20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E2").Select
Application.ScreenUpdating = True
End Sub