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: 7
Default Macro for setting range of Vlookup formula's

Hey folks,

I'm hoping someone can help me figure this out as I've been searching help
files and different blog sites trying to find a macro for this...

I have a text file that I am converting to Excel, but it defaults to having
all of the info in Column A. I have no problem delimiting it, but the only
way I can delimit it reliably is by breaking it up at every space. There are
headers built in that I need to search for and then take the info from the
cell directly to the right of the header once i find it and put it into the
new spreadsheet.

If the report was formatted right I could just use some 'if-then' type of
macro's using R1C1 formulas to do this, but the problem is that this report
runs between 2000-3000 rows, where one record on the report could be anywhere
from 6 to 14 rows, and to complicate it further, if there are multiple
records for the same account it lists the account level information (such as
account holder name and account number) once, then lists all of the records
for that account following the header. (each record is seperated by a blank
row)

The last complication is that the report i'm converting is really set up to
be printed rather than put into an excel file, so where each printed page
would end, it stops the record it's on, inserts a header for the next page
which includes the same account level information and continues the record it
was printing.

I've got a macro to take all of the page headers out, and I have the coding
I need to handle the problem with dropping the account number down for each
record already.

I THINK I need a macro to go in and look at column B, then set up a lookup
table for each record. All of the records start with a cell (in column B)
that has the text value of "REF:". I'm thinking if I could come up with a
macro to have it set the lookup range for each record from the row that
contains REF to the last row before the next REF, from columns B - N, I could
then have it find each header I'm looking for using vlookup and then copy the
cell to the right of it to the new sheet.

I know it's asking a lot, but if you're taken the time to read this whole
post, I'm guessing you may be willing to help out... Does anyone have at
least any pointers to give me that might get me at least in the right
neighborhood for this?

--
Marty
 
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
Data Validation - List - Setting Range from a macro dhstein Excel Discussion (Misc queries) 5 May 14th 09 01:11 PM
help with vlookup, offset or match formula's Gary Excel Worksheet Functions 0 January 5th 09 12:48 PM
Setting print range with macro Deeds Excel Programming 4 October 4th 05 04:22 PM
setting range from activecell in macro Giz Excel Programming 1 March 11th 05 05:16 PM
Macro in VBA: Setting a variable print range HELP NEEDED!! Ron de Bruin Excel Programming 1 July 21st 04 05:45 PM


All times are GMT +1. The time now is 08:52 AM.

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"