Writing a macro in Excel

  Pusherman 23:15 23 Jun 2003
Locked

I have an Excel spreadsheet (called AccList.xls) that has several columns in it. In the 'A' column I have file names for other spreadsheet workbooks; jsmith.xls, fbloggs.xls and so on. In the master workbook (AccList.xls) I want to run a macro that will look down the 'A' column and pickup the next file name and access that workbook, read in some of that data and print it out depending on certain conditions and then move onto the next filename in the next cell down. How do I access another spreadsheets data?

Any help (or any info on good resource sites) greatly appreciated.

Pusherman.

  Pusherman 10:50 24 Jun 2003

Refreshing in the hope that someone can help.

  seedie 11:45 24 Jun 2003

('C:\files\[shopping.xls]Sheet1'!AH170:AH350

This shows how to acces another sheet-you may have to fiddle a bit to get it to work for you. You will also need to look up about array variables in help.
VOG's your man.


CD

  Ben Avery 11:48 24 Jun 2003

I'd wait until VoG is here and ask him. He's the Harry Potter (or Gandalf if you prefer) of Excel!

BA

  VoG® 17:27 24 Jun 2003

Yo haven't given much of a clue as to how much you know about writing VBA code. Assuming that you know something then your subroutine would include something along the lines of:

Dim MyFile as String
MyFile = ActiveSheet.Range("A1").Value
Workbooks.Open(MyFile)

If you don't know anything about VBA this is a rather ambitious project to start with. Here is some background click here

Sorry for late response - I've been on my travels, and not a worksheet in sight!

  VoG® 17:28 24 Jun 2003

Dim MyFile as String

MyFile = ActiveSheet.Range("A1").Value

Workbooks.Open(MyFile)

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Xiaomi Mi Mix 2 review

What went wrong at the Designs of the Year 2017

iPhone X news: Release date, price, new features & specs

Comment utiliser Live Photos ?