Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Variable Cell Value within a macro
I have a limited ability with macros. I record them rather than write them.
What I'm trying to do is write a macro that will copy a cell value and paste it to another sheet. Sounds simple. But the location it needs to be pasted is a variable row with a fixed column. I have a cell on sheet 1 (F7) which details the cell to go to in sheet 2 (R?C33) (?= variable row). Can anyone advise. Many thanks. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Variable Cell Value within a macro
Option Explicit
sub testme() dim DestCell as range dim OrigCell as range set origcell = worksheets("sheet1").range("f7") with worksheets("sheet2") set destcell = .cells(.rows.count,33).end(xlup).offset(1,0) end with origcell.copy _ destination:=destcell 'or destcell.value = origcell.value end sub I used the next available row in column 33. Ron (Bismark) wrote: I have a limited ability with macros. I record them rather than write them. What I'm trying to do is write a macro that will copy a cell value and paste it to another sheet. Sounds simple. But the location it needs to be pasted is a variable row with a fixed column. I have a cell on sheet 1 (F7) which details the cell to go to in sheet 2 (R?C33) (?= variable row). Can anyone advise. Many thanks. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell References | Excel Discussion (Misc queries) | |||
How to set variable to cell value in excel macro | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
copying cell names | Excel Discussion (Misc queries) | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions |