![]() |
Looking Up Numbers in a Table Using VBA
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 |
Looking Up Numbers in a Table Using VBA
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) "musicalhamster" wrote in message om... 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 |
All times are GMT +1. The time now is 10:19 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com