Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
newbie ?: set variables, different shts, equal to each other
(This is a super-simple softball lofted to the group...)
I've got a (column) range in each of 2 sheets, call them TestSrc & TestDest. I want to have the cells in TestDest dependent on the other sht's range, so that whenever a value's entered in, for example, TestSrc!B2, it instantly shows up in TestDest!C2. (I know I could manually-select the destination-cell and enter "=TestSrc!B2", but there's a couple-hundred 'source-cells' & I'd like to automate it.) Also: the range of cells in TestSrc sheet is in one column but is not contiguous. I feel comfortable w/ building the looping code for this, but am stumbling over the very basic syntax of how to set one variable on one sht equal to a var on another--and do it so that any changes on source sht would instantly show up on the other w/out any copying, pasting, etc. What I've tried: Sub LinkCellsDiffShts() Dim SrcRge As Range Dim DestRge As Range Set SrcRge = Worksheets("TestSrc").Range("B2") Set DestRge = Worksheets("TestDest").Range("C2") Sheets("TestDest").Range(DestRge). _ Value = Sheets("TestSrc").Range(SrcRge).Value End Sub I'm getting error msges from this, & don't know how to fix it. Any help would be greatly appreciated [:-)) terry b. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Compare Rows on 2 shts .... | Excel Discussion (Misc queries) | |||
Newbie Macro Query - Clearing Variables and Assigning a Variable | Excel Programming | |||
Randomize three variables subject to sum always equal to 1 | Excel Programming | |||
Randomize three variables subject to sum always equal to 1 | Excel Programming | |||
Copying shts from one wbk to another | Excel Programming |