Redundant

S

Striker

The third line does not work, so I commented it out and am using the 4th
line, but this seems a little redundant to me. What is wrong with it.


Set WB = Workbooks("Template_CK Ordered.xls")
Set SH = WB.Sheets("CO_Template")
'Set rDestCell = WB.SH.Range("A2")
Set rDestCell = Workbooks("Template_Ck
Ordered.xls").Worksheets("CO_Template").Range("A2")
Set wkbkCSV = Workbooks.Open(Filename:=sFile1)
 
T

Tom Ogilvy

Set WB = Workbooks("Template_CK Ordered.xls")
Set SH = WB.Sheets("CO_Template")
Set rDestCell = SH.Range("A2")

Set wkbkCSV = Workbooks.Open(Filename:=sFile1)

You don't need the WB in the 3rd line. SH already knows it belongs to WB.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top