-
hi pk, this code i have i am not able to figure out why it says object variable or with block variable not set could you please take a look, many thanks
Code:
Windows("CNAV.xlsm").Activate
Set rngcopy = Sheets("Raw data").Range("A1:IV1").Find("Accrual excl XD+3", LookIn:=xlValues)
Set rngcopy = Range(rngcopy.Offset(1, 0), Cells(Rows.Count, rngcopy.Column).End(xlUp))
Set rngPaste = Workbooks("DummyIACB.xlsm").Sheets("Sheet1").Range("l2")
rngcopy.Copy
rngPaste.PasteSpecial xlPasteValues
rngPaste.PasteSpecial xlPasteFormats
-
hi pk, this code i have i am not able to figure out why it says object variable or with block variable not set could you please take a look,
the error pops at third line, when i close all the workbooks and open only the workbook which has this code it works fine, many thanks
Code:
Windows("CNAV.xlsm").Activate
Set rngcopy = Sheets("Raw data").Range("A1:IV1").Find("Accrual excl XD+3", LookIn:=xlValues)
Set rngcopy = Range(rngcopy.Offset(1, 0), Cells(Rows.Count, rngcopy.Column).End(xlUp))
Set rngPaste = Workbooks("DummyIACB.xlsm").Sheets("Sheet1").Range("l2")
rngcopy.Copy
rngPaste.PasteSpecial xlPasteValues
rngPaste.PasteSpecial xlPasteFormats
-
hi p45, this code i have i am not able to figure out why it says object variable or with block variable not set could you please take a look,
the error pops at third line, when i close all the workbooks and open only the workbook which has this code it works fine,
i have tried to add Dim rngcopy As Object but it did not work, many thanks
Code:
Dim rngcopy As Object
Windows("CNAV.xlsm").Activate
Set rngcopy = Sheets("Raw data").Range("A1:IV1").Find("Accrual excl XD+3", LookIn:=xlValues)
Set rngcopy = Range(rngcopy.Offset(1, 0), Cells(Rows.Count, rngcopy.Column).End(xlUp))
Set rngPaste = Workbooks("DummyIACB.xlsm").Sheets("Sheet1").Range("l2")
rngcopy.Copy
rngPaste.PasteSpecial xlPasteValues
rngPaste.PasteSpecial xlPasteFormats
-
hi p45, this code i have i am not able to figure out why it says run time error 91 "object variable or with block variable not set" could you please take a look,
the error pops at third line, when i close all the workbooks and open only the workbook which has this code it works fine,
i have tried to add "Dim rngcopy As Object" but it did not work, many thanks
Code:
Windows("CNAV.xlsm").Activate
Set rngcopy = Sheets("Raw data").Range("A1:IV1").Find("Accrual excl XD+3", LookIn:=xlValues)
Set rngcopy = Range(rngcopy.Offset(1, 0), Cells(Rows.Count, rngcopy.Column).End(xlUp))
Set rngPaste = Workbooks("DummyIACB.xlsm").Sheets("Sheet1").Range("l2")
rngcopy.Copy
rngPaste.PasteSpecial xlPasteValues
rngPaste.PasteSpecial xlPasteFormats