Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Copy range from one open workbook's worksheet to another.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy range from one open workbook's worksheet to another.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy range from one open workbook's worksheet to another.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Copy range from one open workbook's worksheet to another.

the latter part of the workbook name changes.
Is this the correct way to say that in this code?

"ALL_TO_ONE*"
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Copy range from one open workbook's worksheet to another.

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
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
Can Excel list all of a workbook's worksheets on a worksheet? [email protected] Excel Worksheet Functions 2 April 3rd 08 12:14 AM
Copy & paste cells fr open worksheet then close the worksheet Sin Excel Programming 1 October 2nd 06 02:20 PM
select open webpage, copy information to open worksheet Kevin Excel Programming 2 September 5th 06 05:10 AM
Copy from different workbook's worksheet into a single worksheet... [email protected] Excel Discussion (Misc queries) 1 October 27th 05 07:27 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM


All times are GMT +1. The time now is 12:29 PM.

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

About Us

"It's about Microsoft Excel"