-
Hello all.
Here is my question.... I have an excel spreadsheet, it has two columns in it. First what is the simplest code to se how many rows inthe first column?
second question.. Is there code to look for a value in that first row and if it finds it tell the location of that value like 12,1 or 45,1 or 7,1
I am only interested in data in the this first column, I need to see if its there and then what the cordinates are. Thanks for any help
-
Hello Steel!
For the first question, you can use one of the following technique.
Code:
'PURPOSE: Count the number of records
Dim intLastRow
'Method 1
intLastRow = ActiveCell.SpecialCells(xlLastCell).Row
'Method 2
intLastRow = ActiveSheet.UsedRange.Rows.Count
'Method 3
intLastRow = ActiveCell.EntireRow.Count
For the second question, you should look up the WORKSHEET function "Vlookup". You should look up "Activecell.Address" for the CODE.
Keep me up to post!
See Ya!
-
Thanks for the help Nitro. that worked great for the first part. Forgive me of my ignorance, but do you mean to look it up in the MSDN help?
Thanks again
-
No ignorance at all!
You should look up the function "Vlookup", under the function icon button on your toolbar. Once you know how to do this on the worksheet, you can converted it to a code function by simply placing the word "Worksheet.VLookup".
As for the address, you can just type in "Activecell.Address" in the code area. Place you cursor on the word "Address" and hit F1.
Steel! I have to leave right now, but if you still have trouble with it, post again and when I come back tonight I will help you out.
Sorry!
[Edited by Nitro on 04-24-2000 at 08:14 PM]