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
 
Hi Dave,

thanks, just a silly question, what does ":=" meant ?

thanks
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top