ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell variable name (https://www.excelbanter.com/excel-programming/380861-cell-variable-name.html)

BSII

Cell variable name
 
I am writing a custom macro and have a very basic question... I want to
locate a certain cell by seraching for a specific word and then automatically
highlight a range of cells under or next to that cell. I can do this
manually by Searching for that keyword (which locates the cell in my
workbook) and then SHIFT+ARROWS to hightlight the adjacent cells. However,
when I try to automate this in a macro, it finds the cell ok, but then
records the hard values of the cell range rather than being referenced to the
cell that a searched for. The result is that the macro ends up finding the
same range rather than searching each workbook individually.

Any thoughts? If there was a way locate the keyword by the Search command
and then somehow copy the cell's address as a variable, I could probably work
out a formula from there, but I don't see a way to copy the cell's address.

Thank you for any help.

Don Guillett

Cell variable name
 
As always, post YOUR coding efforts for comments and suggestions.

--
Don Guillett
SalesAid Software

"BSII" wrote in message
...
I am writing a custom macro and have a very basic question... I want to
locate a certain cell by seraching for a specific word and then
automatically
highlight a range of cells under or next to that cell. I can do this
manually by Searching for that keyword (which locates the cell in my
workbook) and then SHIFT+ARROWS to hightlight the adjacent cells.
However,
when I try to automate this in a macro, it finds the cell ok, but then
records the hard values of the cell range rather than being referenced to
the
cell that a searched for. The result is that the macro ends up finding
the
same range rather than searching each workbook individually.

Any thoughts? If there was a way locate the keyword by the Search command
and then somehow copy the cell's address as a variable, I could probably
work
out a formula from there, but I don't see a way to copy the cell's
address.

Thank you for any help.





All times are GMT +1. The time now is 06:41 AM.

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