Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check to see if a workbook entitled "All_to_One...." is open.
("..." represents other miscellaneous wording). If open, select 1st worksheet in this workbook. (Will only be one worksheet in workbook.) Copy this range. Range("a4:f4").Select Range(Selection, Selection.End(xlDown)).Select Go to workbook entitled "Apples and oranges" Go to sheet "blueberries" Paste at range a4:f4. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set DestSht = Workbooks("Apples and oranges") _
.Sheets("blueberries") For Each bk In Workbooks If UCase(bk.Name) = "ALL_TO_ONE...." Then LastRow = bk.Range("A4").End(xlDown).Row bk.Range("B4:F" & LastRow).Copy _ Destination:=DestSht.Range("A4") Exit For End If Next bk "J.W. Aldridge" wrote: Check to see if a workbook entitled "All_to_One...." is open. ("..." represents other miscellaneous wording). If open, select 1st worksheet in this workbook. (Will only be one worksheet in workbook.) Copy this range. Range("a4:f4").Select Range(Selection, Selection.End(xlDown)).Select Go to workbook entitled "Apples and oranges" Go to sheet "blueberries" Paste at range a4:f4. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I forgot to include a sheet reference in the All_toOne workbook
Set DestSht = Workbooks("Apples and oranges") _ .Sheets("blueberries") For Each bk In Workbooks If UCase(bk.Name) = "ALL_TO_ONE...." Then With bk.Sheets(1) LastRow = .Range("A4").End(xlDown).Row .Range("B4:F" & LastRow).Copy _ Destination:=DestSht.Range("A4") Exit For End If Next bk "J.W. Aldridge" wrote: Check to see if a workbook entitled "All_to_One...." is open. ("..." represents other miscellaneous wording). If open, select 1st worksheet in this workbook. (Will only be one worksheet in workbook.) Copy this range. Range("a4:f4").Select Range(Selection, Selection.End(xlDown)).Select Go to workbook entitled "Apples and oranges" Go to sheet "blueberries" Paste at range a4:f4. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the latter part of the workbook name changes.
Is this the correct way to say that in this code? "ALL_TO_ONE*" |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you've already got another thread re this
however for exact likes you'd use "=" but where the sheet names begin the same but end differently, then yes, the aterisk is the 'any character' symbol and you use it with the 'LIKE' condition as given in Rick Rothstein's reply to your "Search Open Workbooks..." question so IF mytext LIKE "ABC*" THEN END IF would be true for text string starting with "ABC" such ABCD and ABCFG "J.W. Aldridge" wrote in message ... the latter part of the workbook name changes. Is this the correct way to say that in this code? "ALL_TO_ONE*" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can Excel list all of a workbook's worksheets on a worksheet? | Excel Worksheet Functions | |||
Copy & paste cells fr open worksheet then close the worksheet | Excel Programming | |||
select open webpage, copy information to open worksheet | Excel Programming | |||
Copy from different workbook's worksheet into a single worksheet... | Excel Discussion (Misc queries) | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming |