Posted to microsoft.public.excel.programming
|
|
Use a cell value to point to desired location.
Hi A,
Thanks, however, when I execute the line:
Y=Mid([a1],ComPos+1,5)
I encountered an "Type mismatched" error, any idea why?
"avveerkar" wrote:
GeneWan Wrote:
scenario 1: say, if cell A1 contains the value 10,2 and cell D1
contains
value 8.
scenario 2: say, if cell A1=10, cell B2=2 and D1=8.
how can I write a macro to select the cell J2 (ie. 10,2) and place the
value
8 in it? ie. use the values as an X,Y coordinate. Which would be the
more
efficient way of doing it?
scenario 1
ComPos=Instr(1,[a1],",") ' locate comma
X=Val(Left([a1],ComPos-1))
Y=Mid(([a1],ComPos+1,5))
Cells(Y,X)=[d1]
scenario 2
cells([b2],[[a1]).value=[d1]
A V Veerkar
--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=513481
|