ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find reference to specific range in code (https://www.excelbanter.com/excel-programming/408187-find-reference-specific-range-code.html)

[email protected]

Find reference to specific range in code
 
Hallo,
Is there any fast way to check if a specific worksheet range is
referred to in my VBA code? (Find ???)
I suppose it's a common problem when you move data from unnamed cells
in a worksheet to another place on the same worksheet . It may
require to review all the references in the code that refer to the
changed cells.
Thanks for any advice.
Herman

Jim Cone

Find reference to specific range in code
 
Hello,
Find/Replace in the VBE works pretty much the same as it does
on an Excel worksheet.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





wrote in message
Hallo,
Is there any fast way to check if a specific worksheet range is
referred to in my VBA code? (Find ???)
I suppose it's a common problem when you move data from unnamed cells
in a worksheet to another place on the same worksheet . It may
require to review all the references in the code that refer to the
changed cells.
Thanks for any advice.
Herman

[email protected]

Find reference to specific range in code
 
On 23 mrt, 13:55, "Jim Cone" wrote:
Hello,
Find/Replace in the VBE works pretty much the same as it does
on an Excel worksheet.
--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


wrote in message
Hallo,
Is there any fast way to check if a specific worksheet range is
referred to in my VBA code? (Find ???)
I suppose it's a common problem when you move data from unnamed cells
in a worksheet to another place on the same worksheet . *It may
require to review all the references in the code that refer to the
changed cells.
Thanks for any advice.
Herman


Thank you Jim.
I know how to work with find and replace in theVBA code but if you
move e.g. only a 3 by 3 range on the worksheet you have to do that
find and replace thing 9 times, not counting the absolute vs relative
possibilities!!
So I thougt there might be some better idea.
Thanks anyway
Herman



Jim Cone

Find reference to specific range in code
 

Not a problem if you use an object reference to refer to the range...
Dim rngCells as Excel.Range
Set rngCells = Worksheets("Mush").Range ("E3:G5")

Now if you want to change the range you only have to change one line.
Please top post. I have already read my own post.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




wrote in message
On 23 mrt, 13:55, "Jim Cone" wrote:
Hello,
Find/Replace in the VBE works pretty much the same as it does
on an Excel worksheet.
--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





wrote in message
Hallo,
Is there any fast way to check if a specific worksheet range is
referred to in my VBA code? (Find ???)
I suppose it's a common problem when you move data from unnamed cells
in a worksheet to another place on the same worksheet . It may
require to review all the references in the code that refer to the
changed cells.
Thanks for any advice.
Herman


Thank you Jim.
I know how to work with find and replace in theVBA code but if you
move e.g. only a 3 by 3 range on the worksheet you have to do that
find and replace thing 9 times, not counting the absolute vs relative
possibilities!!
So I thougt there might be some better idea.
Thanks anyway
Herman




All times are GMT +1. The time now is 02:32 AM.

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