View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Enter data in cell referenced in a cell

Brian was thinking very hard :
On Thursday, April 26, 2012 8:15:16 PM UTC+2, GS wrote:
Brian submitted this idea :
In cell A2 I have determined the number 3
In A3 I have created a cell reference
Scoresheet1!AD3
Which references a cell on another sheet,
I am looking for the VBA code which will enable me to place the number in
cell A2 in the cell rerenced in cell A3 I am using Excel 2007
appreciate any help.


This presumes the sheet containing the target cell (A2) is the active
sheet, AND the cell containing the ref (A3) is the active cell.

Dim vSource As Variant
vSource = Split(ActiveCell.Value, "!")
ActiveCell.Offset(0, -1).Value = _
Sheets(vSource(0)).Range(vSource(1)).Value

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Thank you this works perfectly. Your assistance is much appreciated


You're welcome! I appreciate the feedback...

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion