Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi to all!!!
I have two woorkbook opened. Book1 and Book_cup. I need to activate Book_cup from Book1 and copy some data with code. Book_cup change name everyday but is allvays finished with word "cup". regards lopina |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Dim wb As Workbook For Each wb In Workbooks If wb.Name Like "*cup.xls" Then With wb.Sheets(1).Range("A1:J100") ThisWorkbook.Sheets(1).Range("B2").Resize( _ .Rows.Count, .Columns.Count).Value = .Value End With Exit For End If Next wb Note that there's no need to activate if you work with range objects directly. In article , "lopina" wrote: Hi to all!!! I have two woorkbook opened. Book1 and Book_cup. I need to activate Book_cup from Book1 and copy some data with code. Book_cup change name everyday but is allvays finished with word "cup". regards lopina |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks
It is working regards lopina "JE McGimpsey" wrote in message ... One way: Dim wb As Workbook For Each wb In Workbooks If wb.Name Like "*cup.xls" Then With wb.Sheets(1).Range("A1:J100") ThisWorkbook.Sheets(1).Range("B2").Resize( _ .Rows.Count, .Columns.Count).Value = .Value End With Exit For End If Next wb Note that there's no need to activate if you work with range objects directly. In article , "lopina" wrote: Hi to all!!! I have two woorkbook opened. Book1 and Book_cup. I need to activate Book_cup from Book1 and copy some data with code. Book_cup change name everyday but is allvays finished with word "cup". regards lopina |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect single sheets in the woorkbook | Excel Worksheet Functions | |||
Printing entire woorkbook | Excel Discussion (Misc queries) | |||
Woorkbook toolbar | Excel Discussion (Misc queries) | |||
Opening a excel woorkbook from VBA | Excel Programming | |||
woorkbook | Excel Worksheet Functions |