ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy cell to reference contained in another cell (https://www.excelbanter.com/excel-programming/362496-copy-cell-reference-contained-another-cell.html)

Worldman1

copy cell to reference contained in another cell
 
another procedure I'm struggling with -

Cell B1 contains a variable cell reference, for example "E:14"
I want to copy contents of cell $E$4 to the cell reference pointed to
in the above

Can't make it work - help would be appreciated . . .

(does anyone know where can I find a comprehensive syntax guide?)

Probably my last question - for now at least . .

Thanks in advance . . .

RonW.


Norman Jones

copy cell to reference contained in another cell
 
Hi Worlman1,

Try:

Range("E4").Copy Destination:=Range(Range("B1").Value)


---
Regards,
Norman



"Worldman1" wrote in message
ps.com...
another procedure I'm struggling with -

Cell B1 contains a variable cell reference, for example "E:14"
I want to copy contents of cell $E$4 to the cell reference pointed to
in the above

Can't make it work - help would be appreciated . . .

(does anyone know where can I find a comprehensive syntax guide?)

Probably my last question - for now at least . .

Thanks in advance . . .

RonW.




Worldman1

copy cell to reference contained in another cell
 
Hi Norman,

Thanks, but there apears to be a syntax error . .

Cheers,
RonW.


Norman Jones

copy cell to reference contained in another cell
 
Hi Worldman1,

Thanks, but there apears to be a syntax error . .


I do not think so - it works for me.

However, try the following fully qualified version:

'=============
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet

Set WB = Workbooks("YourBook.xls") '<<==== CHANGE
Set SH = WB.Sheets("Sheet1") '<<==== CHANGE

With SH
.Range("E4").Copy Destination:=.Range(.Range("B1").Value)
End With

End Sub
'<<=============


---
Regards,
Norman



"Worldman1" wrote in message
oups.com...
Hi Norman,

Thanks, but there apears to be a syntax error . .

Cheers,
RonW.





All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com