|
-
Apr 24th, 2000, 09:19 AM
#1
Thread Starter
Member
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
-
Apr 24th, 2000, 09:54 AM
#2
Fanatic Member
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!
Chemically Formulated As:
Dr. Nitro
-
Apr 24th, 2000, 09:58 AM
#3
Thread Starter
Member
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
-
Apr 24th, 2000, 10:13 AM
#4
Fanatic Member
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]
Chemically Formulated As:
Dr. Nitro
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|