#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default linked cell

Hi.

Ive got a small question
Is there a possibility to link the VBA code to the cells? So when you are
referring to cell A1 and you insert a row the VBA script automatically
changes the value to A2.

Best regards,

Chris

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default linked cell

Click on the cell A1 then Insert(menu) Name Define ... name it "mycell"
Try inserting rows and columns the code below should refer to the same cell
because named ranges keep there relative reference when cells, columns or
rows are deleted or inserted.

Range("mycell") = Range("mycell") + 1

--
Regards,
Rocky McKinley


"chris" wrote in message
...
Hi.

I've got a small question
Is there a possibility to link the VBA code to the cells? So when you are
referring to cell A1 and you insert a row the VBA script automatically
changes the value to A2.

Best regards,

Chris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default linked cell

use named ranges.
So when you insert a row, the named range also shifts and your VBA code is
not affected.

Mangesh



"chris" wrote in message
...
Hi.

I've got a small question
Is there a possibility to link the VBA code to the cells? So when you are
referring to cell A1 and you insert a row the VBA script automatically
changes the value to A2.

Best regards,

Chris



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I have a linked cell auto-size to fit the linked data? CristinPDX Excel Discussion (Misc queries) 0 June 24th 08 08:42 PM
Using a cell reference to create linked info in another cell LCrowe Excel Discussion (Misc queries) 2 February 28th 08 05:26 PM
In Cell Validation List & Linked Cell VLOOKUP BEEZ Excel Discussion (Misc queries) 7 July 1st 07 07:17 PM
How to force a cell value to change if Linked cell moves? EagleOne Excel Discussion (Misc queries) 2 December 6th 06 03:32 PM
how do i record changing cell data (cell is dde linked) Morph Excel Discussion (Misc queries) 1 September 22nd 05 12:28 AM


All times are GMT +1. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"