#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Redundant

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)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Redundant

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.

--
Regards,
Tom Ogilvy




"Striker" wrote:

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)



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Consolidating Redundant Text Brad Autry Excel Worksheet Functions 2 January 6th 10 06:39 PM
Redundant data ale Excel Discussion (Misc queries) 1 May 14th 07 06:51 PM
minimizing redundant code dreamz[_31_] Excel Programming 4 March 10th 06 08:17 PM
Password redundant through use of cancel Blokeyfella Excel Discussion (Misc queries) 1 February 1st 06 05:00 PM
finding redundant data eternal_cat via OfficeKB.com Excel Worksheet Functions 1 December 8th 05 07:53 AM


All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"