Looking Up Numbers in a Table Using VBA

M

musicalhamster

Hi.
I have created a program for myself to generate the code for an HTML
pictures page, using about 7 parameters I have specified (width,
height, border, gap etc...). I would like it to be able to check if
the current rownumber in the array (as it is filled in) is in a list
of numbers on my spreadsheet. This is so that I can write into my
spreadsheet the numbers of the portrait orientated pictures, and the
array will put into a box that this picture number is portrait
orientated (important for data later in my code).
I have only been using VBA for a few days, and I have managed to
produce all of my code using help files and google groups, but I can't
find how to do this anywhere.
Also, if possible, I'd like to be able to write my list in one cell -
using the same style as when you print selected pages. ie, 1-12, 14,
16-21 would select pictures 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14,
16, 17, 18, 19, 20, 21. Is this possible?
Please help!
Simon
 
B

Bob Phillips

Does this help

Dim i As Long

On Error Resume Next
i = Application.Match(3, Range("A1:A10"), 0)
On Error GoTo 0
If i > 0 Then
MsgBox "Found"
End If


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top