return dynamic current active cell!!

  • Thread starter Thread starter Ginola
  • Start date Start date
G

Ginola

Hi, I have tried to write few lines codes to cut and paste the active
sheet code to offset ( 2, 1 ). However, when I record the macro, it
use the static value "D6". However can I change this code so that it
can be dynamic ?

hope you understand my poor english
thanks



Selection.Cut
Range("D6").Select
ActiveSheet.Paste
 
Like this:

Activecell.cut _
destination:=activecell.offset(2,1)

or

with activeCell
.cut _
Destination:=.Offset(2,1)
end with
 
It means equal to.

But it's different than the assignment of a variable:

dim myVal as String
myVal = "this is a string"
(which just uses the plain old equal sign)

When you specify a parameter to a function/procedure/method, excel uses := as
the equal symbol.
 
Back
Top