ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find variable cell text in another range (https://www.excelbanter.com/excel-programming/347095-find-variable-cell-text-another-range.html)

Andyroo

Find variable cell text in another range
 
I am developing a macro that needs to find whatever text is in cell A33 of
sheet1 in a range on sheet2. Cell A33 text changes depending on the
selection made from a userform.

I have figured out a very, very long winded IF, ELSE IF code that uses all
possible values that could be in cell A33 but am hoping there is a simpler
way to do it.

I have trawled through Excel and Excel VBA help and cant find what I need.

Niek Otten

Find variable cell text in another range
 
Use the macro recorder. Copy A33, EditFind, Paste in the Find what box, do
what you want to do with it.
Then look at the generated code and change to your needs.

--
Kind regards,

Niek Otten

"AndyRoo" wrote in message
...
I am developing a macro that needs to find whatever text is in cell A33 of
sheet1 in a range on sheet2. Cell A33 text changes depending on the
selection made from a userform.

I have figured out a very, very long winded IF, ELSE IF code that uses all
possible values that could be in cell A33 but am hoping there is a simpler
way to do it.

I have trawled through Excel and Excel VBA help and cant find what I need.




Andyroo

Find variable cell text in another range
 
That was perfect, thanks.

"Niek Otten" wrote:

Use the macro recorder. Copy A33, EditFind, Paste in the Find what box, do
what you want to do with it.
Then look at the generated code and change to your needs.

--
Kind regards,

Niek Otten

"AndyRoo" wrote in message
...
I am developing a macro that needs to find whatever text is in cell A33 of
sheet1 in a range on sheet2. Cell A33 text changes depending on the
selection made from a userform.

I have figured out a very, very long winded IF, ELSE IF code that uses all
possible values that could be in cell A33 but am hoping there is a simpler
way to do it.

I have trawled through Excel and Excel VBA help and cant find what I need.






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

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