View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default 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