ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   question macros (https://www.excelbanter.com/excel-worksheet-functions/30208-question-re-macros.html)

wnl2007

question macros
 

I need to know whether macros can be used to "grab" data in a cell
reference, no matter where that cell may be. For instance, If I need
to insert a new column in sheet 4, and the column that gets shifted is
referenced in sheet 5, I want to make sure the reference can process
that change, so that I don't have to continuously change my formulas.


--
wnl2007
------------------------------------------------------------------------
wnl2007's Profile: http://www.excelforum.com/member.php...o&userid=24200
View this thread: http://www.excelforum.com/showthread...hreadid=378136


JMB

if the only thing referencing your data are excel worksheet functions on
sheet 5, excel will update your links automatically.

if you have macros that are referencing your data, they will not update when
your data is moved. one possibility is to use a named range. you could name
the column "MyColumn", then in your macro it would be

Range("MyColumn")

to refer to this range and

Range("MyColumn") (1,1)
or
Range("MyColumn).Cells(1,1)

to refer to the cell in the first row and first column of "MyColumn".



"wnl2007" wrote:


I need to know whether macros can be used to "grab" data in a cell
reference, no matter where that cell may be. For instance, If I need
to insert a new column in sheet 4, and the column that gets shifted is
referenced in sheet 5, I want to make sure the reference can process
that change, so that I don't have to continuously change my formulas.


--
wnl2007
------------------------------------------------------------------------
wnl2007's Profile: http://www.excelforum.com/member.php...o&userid=24200
View this thread: http://www.excelforum.com/showthread...hreadid=378136




All times are GMT +1. The time now is 04:58 PM.

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