LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default referencing workbook from cells in another workbook


Hi,

I'm trying to work out where I'm going wrong with the below but I've
been stuck for a while and would appreciate any help.

I have a load of open workbooks to start of with, from where I am going
to drag data. I then look to open the following workbook 'Names' which
is a list of partial names of files ie cell a1 is MLUD*.xls

What I'm trying to do is select the first cell in the names spreadsheet
"single", use this as a reference to activate an already open workbook
with the name similar to MLUD*.xls and then copy data from this newly
activated workbook (from the worksheet "Raw" to another file.

So far I've tried the below, but I'm obviously missing something in
the syntax as it's not working
Any help would be really gratefully appreciated

thanks Joe

Sub MoveData ()

Dim WB As Workbook

Workbooks.Open ("S:\Names")
Worksheets("Single").Range("A1").Select

For Each WB In Application.Workbooks
If WB.Name Like ActiveCell.Value Then
WB.Activate

'Copy & Paste Data

Worksheets("Raw").Select
Range("b7:b10").Select
Application.CutCopyMode = False
Selection.Copy
Workbooks("Macro Examples").Activate
Range("e7").Select
If ActiveCell.Value = "" Then
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Else: ActiveCell.Offset(0, 1).Select
End If




Exit For
End If
Next WB

End Sub


--
jlejehan
------------------------------------------------------------------------
jlejehan's Profile: http://www.excelforum.com/member.php...o&userid=33950
View this thread: http://www.excelforum.com/showthread...hreadid=538331

 
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
Copy cells based on conditions in one workbook to another workbook fLiPMoD£ Excel Worksheet Functions 0 August 1st 07 07:43 PM
How do I save an Excel workbook so that cells referencing another. williejoeshaver Excel Discussion (Misc queries) 1 March 11th 05 09:44 PM
Referencing cells in another workbook Don Guillett[_4_] Excel Programming 1 August 31st 04 02:18 PM
Referencing cells in another workbook Tom Ogilvy Excel Programming 0 August 31st 04 02:08 PM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM


All times are GMT +1. The time now is 09:58 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"