LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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
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 to Compare Rows on 2 shts .... Les Wegg Excel Discussion (Misc queries) 0 May 11th 05 03:25 PM
Newbie Macro Query - Clearing Variables and Assigning a Variable Mcneilius[_5_] Excel Programming 3 September 5th 04 11:10 AM
Randomize three variables subject to sum always equal to 1 emsfeld[_3_] Excel Programming 32 September 5th 04 10:18 AM
Randomize three variables subject to sum always equal to 1 mangesh_yadav[_49_] Excel Programming 0 August 31st 04 08:00 AM
Copying shts from one wbk to another jacqui[_2_] Excel Programming 2 July 25th 03 04:50 PM


All times are GMT +1. The time now is 05:49 AM.

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"