ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use Array to Goto Certain Rows (https://www.excelbanter.com/excel-programming/301193-use-array-goto-certain-rows.html)

D

Use Array to Goto Certain Rows
 
I'd like to create a "goto" type of dialog for an excel worksheet that I have various macros in. The find and select code shouldn't be much of a problem, but what I'd like to do is have the userform have 2 listboxes. One with the information from column A of the worksheet (Job #), the other with info from column B (Job Name). So I imagine I would need to create two arrays. The first populated with the job #s, second populated with the Job Names. But, for the Job Names, I would like to populate the array with just the text that comes before chr(10) in the cell. The Job name cells are all like "Text" + chr(10) + "text" + chr(10) + "text" and I would just like the first line of text to be used in the array.

The idea is to be able to find any job either by the job number or job name, so the way I see the userform working is being able to select either the number or name, have the other listbox move to the corresponding number or name, and then use just the unique job # to do the actual search and goto opearation.

Any help would be great.

D

Use Array to Goto Certain Rows
 
Nevermind, got it figured out

"D" wrote:

I'd like to create a "goto" type of dialog for an excel worksheet that I have various macros in. The find and select code shouldn't be much of a problem, but what I'd like to do is have the userform have 2 listboxes. One with the information from column A of the worksheet (Job #), the other with info from column B (Job Name). So I imagine I would need to create two arrays. The first populated with the job #s, second populated with the Job Names. But, for the Job Names, I would like to populate the array with just the text that comes before chr(10) in the cell. The Job name cells are all like "Text" + chr(10) + "text" + chr(10) + "text" and I would just like the first line of text to be used in the array.

The idea is to be able to find any job either by the job number or job name, so the way I see the userform working is being able to select either the number or name, have the other listbox move to the corresponding number or name, and then use just the unique job # to do the actual search and goto opearation.

Any help would be great.



All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com