Hi all -
This line in my code is causing an invalid qualifer error message:
I am unsure why. It seems it should work
Full code below
Thanks
-marc
Code
Option Explicit
Sub Disney_DumpData()
Dim wbBook As Workbook
Dim wbNew As Workbook
Dim ws As Worksheet
Dim wsNew As Worksheet
Dim rng As Range
Dim rngNew As Range
Dim rngUnit As Range
Dim rngUnitPaste As Range
Dim lngNew As Long
Dim Cnt As Integer
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
Set wbBook = ThisWorkbook
Cnt = 0
'Dump To New File
'/Define new workbook
Set wbNew = Application.Workbooks.Add
wbNew.SaveAs "C:\data\delete\Disney_budget_data.xls"
wbNew.Sheets("Sheet1").Name = "Data"
Set wsNew = wbNew.Worksheets("Data")
ActiveWindow.Zoom = 75
'/Copy SLC
'/Data
Set ws = wbBook.Worksheets("Grumpy")
Set rng = ws.Range("A14:X164")
rng.Copy
If Cnt = 0 Then
lngNew = wsNew.Range("B65536").End(xlUp).Row
Else
lngNew = wsNew.Range("B65536").End(xlUp).Row.Offset(1, 0)
End If
Set rngNew = wsNew.Range("B" & lngNew)
rngNew.PasteSpecial (xlPasteValuesAndNumberFormats)
'/Unit Number
Set rngUnit = ws.Range("B3")
rngUnit.Copy
Set rngUnitPaste = wsNew.Range("A" & lngNew + 1, "A" & lngNew + 152)
rngUnitPaste
'/Cleanup - Setup
Set ws = Nothing
Set rng = Nothing
Set rngUnit = Nothing
Set rngUnitPaste = Nothing
Set rngNew = Nothing
Cnt = 1
'/Cleanup
Set wbBook = Nothing
Set wbNew = Nothing
Set ws = Nothing
Set wsNew = Nothing
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
Display More