Help with Excel Macro.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am very new to writing macros and very green.

I have the following macro to copy and paste a column of cells.

Sub copypaste()
'
' copypaste Macro
' Macro recorded 6/22/2005 by
'
' Keyboard Shortcut: Ctrl+q
'
Range("AD3:BF3").Select
Selection.Copy
Range("AD19:BF19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub


In the line [Range("AD19:BF19").Select] is there any way I can get it paste
it in the Active Cell of choice.

Thanks,

Cesar.
 
Sub test3()
Range("AD3:BF3").Copy
ActiveCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

Just don't select range AD3:BF3, then the activecell will not change.
 
Just curious. Why the line of code "Application.CutCopyMode = False".

Thanks

JMB said:
Sub test3()
Range("AD3:BF3").Copy
ActiveCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

Just don't select range AD3:BF3, then the activecell will not change.


Cesar_us said:
I am very new to writing macros and very green.

I have the following macro to copy and paste a column of cells.

Sub copypaste()
'
' copypaste Macro
' Macro recorded 6/22/2005 by
'
' Keyboard Shortcut: Ctrl+q
'
Range("AD3:BF3").Select
Selection.Copy
Range("AD19:BF19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub


In the line [Range("AD19:BF19").Select] is there any way I can get it paste
it in the Active Cell of choice.

Thanks,

Cesar.
 
when you copy and paste items in Excel, you usually have to hit the ESC key
to cancel the copy mode (clear the dashes that appear around your copy
range). that's what that line does. Put an apostrophe ' in front of that
line of code, then run it and look at AD3:BF3.

Cesar_us said:
Just curious. Why the line of code "Application.CutCopyMode = False".

Thanks

JMB said:
Sub test3()
Range("AD3:BF3").Copy
ActiveCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

Just don't select range AD3:BF3, then the activecell will not change.


Cesar_us said:
I am very new to writing macros and very green.

I have the following macro to copy and paste a column of cells.

Sub copypaste()
'
' copypaste Macro
' Macro recorded 6/22/2005 by
'
' Keyboard Shortcut: Ctrl+q
'
Range("AD3:BF3").Select
Selection.Copy
Range("AD19:BF19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub


In the line [Range("AD19:BF19").Select] is there any way I can get it paste
it in the Active Cell of choice.

Thanks,

Cesar.
 

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

Similar Threads

Run-time error 1004 paste method of worksheet class failed 3
Code needs simplifying 5
Emailing an Excel Worksheet 1
Macro Help 1
conso macro 0
Relative navigation in macro 2
Macro 2
Can't Prevent Recalculation 4

Back
Top