View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
hshayh0rn hshayh0rn is offline
external usenet poster
 
Posts: 74
Default Move from a function statement to VBA code?

Well, there really isn't a way for me t restrict the number of rows of data.
This has been a work in progress for the last month or so for me. Here is
what I have. I have 4 worksheets that are given us by another department. The
4 worksheets are .csv files from a batch job and those csv files contain
information about a companies users. The number of users a company has and
how those users have been set up determines the number of rows each of the 4
files will have. By the way, the 4 files all contain similar but still
different data and the amount of data (rows) can be different depending on
how the users were set up. Anyway, my spreadsheet needs to look at those 4
files and import or use the data on them to come up with some useable
information. Up until recently we were doing a manual copy/paste from each
data sheet into the master sheet and then the function I showed previously
filled in the rest. I've since automated the import process but would like to
enchance what I have just a little more. I'm not sure I answred your
question... I can not retrict the number of rows I can look at. The company
I'm working on today only has 157 rows of data but like I said we had one
yesterday with 1010 so It's all over the board. We could do something to
determine the number of row the data sheets have though, right?

If it would help for you to see what I have I could send you a sample of my
master and data files.

"Bob Phillips" wrote:

Do you really need to check every cell, or can the rows/columns be
restricted to a more sensible range?

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"hshayh0rn" wrote in message
...
I have some worksheets that use a Vlookup statement to get information

from
other worksheets. Right now I have the statement below repeated for 1000
rows. I'd like to remove these statement and complete the work entirely in
VBA code. One of the reasons for this is to make the speadsheet a little
quicker in some instances and more dynamic in others. Generally we don't

have
the need for 1000 rows BUT we never truly know how many rows we need and

just
yesterday we needed 1010 rows which meant I had to send out a revised
sheadsheet to that particular user. Could anyone like to help with with

the
code I need to get the same results I would get below? The statement below
appears in cell A2 on a worksheet call "consolidate sheet" and is repeated
for 1000 row but as I mentioned I need it to populate the cells in column

A
of the "consolidated sheet" until there is no more data to get.

=IF(ISERROR(VLOOKUP($D2,'XXX User
Report'!$1:$65536,2,FALSE)),"",VLOOKUP($D2,'XXX User
Report'!$1:$65536,2,FALSE))


Thank you for your help in advance.