View Single Post
  #1   Report Post  
Jeni Q
 
Posts: n/a
Default Complex Macro to perform an operation as it steps down cells?

Greetings. I have a user who is doing a repetitive action in a spreadsheet
and I'm wondering if there's a better way to do what she's doing. Let me
explain the process. (If this is not the appropriate forum, please point me
in the right direction.)

S. has a folder that contains 250-300 PDF files that have a naming
convention like such: GR005843.pdf. In this folder she also has .xls file
that contains fields like Filename, Resume Date, Last Name, etc.
Each file listed in the Filename column corresponds to a PDF file in the
folder and displays the exact title of the file, e.g. "GR005843.pdf".
Currently, she goes to the first data cell in the column, A2, and inserts a
hyperlink into the XLS file by right-clicking and choosing Hyperlink. In the
Insert Hyperlink dialog box, Link to: Existing File or Web Page is
automatically selected. Look in: defaults to Current Folder (which is good
because that's where the files are). The Text to Display: defaults to the
text that is already in the cell. She types in the file name (GR005843.pdf)
in the Address field and chooses OK. Now the text that was in that cell is
replaced by a hyperlink to the corresponding file in the same folder. Then
she moves to A3 and repeats the same steps. She does this about 250-300
times, depending on how many files are in the monthly batch.

I feel like there should be a better way to do this but can't figure out how
a recorded macro could do so. It's the getting to the next cell part that
confuses me. I'm guessing it'll take some VBA code, but I'm not well versed
in that. Can anyone provide some suggestions or advice for me? Can you tell
me if what I'm trying to do is impossible?

I'll be happy to answer any questions or clarify something I did not explain
well.
Thanks in advance for your help.

Jeni Q