View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chevy Chevy is offline
external usenet poster
 
Posts: 6
Default automated copy and past special feature

SEAN C,

OH MY GOODNESS. You are a genious. Hey, how can I become more efficient
with macros? Is there a class that microsoft offers? Thanks again. This
message board rocks. I love it.



"SeanC UK" wrote:

Hi Chevy,

From your code I am assuming that there are formulae in the cells A10 to
Q10, and you are copying them and using Paste Special to paste the values in
place of each formula. I have written something that will do this for the
active row, from A (1) to Q (17). In other words, it will paste the values of
those 17 columns in the active row over themselves. If you were trying to
paste a specific row into the active row, or paste the active row into a
specific row, then let me know and I will rewrite the code for that
particular case.

Public Sub Finish()
Dim lngActiveRow As Long
lngActiveRow = ActiveCell.Row
Range(Cells(lngActiveRow, 1), Cells(lngActiveRow, 17)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
End Sub

I hope this helps,

Sean.




--
(please remember to click yes if replies you receive are helpful to you)


"Chevy" wrote:

Here it is. Thank you so much for looking into this for me.

Sub finish()
'
' finish Macro
' Macro recorded 10/29/2007 by chevalia
'

'
Range("A10:Q10").Select
Selection.Copy
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

"SeanC UK" wrote:

Hi Chevy,

Can you give your code please, it is much easier for people to see any
problems in your code that way.

Cheers,

Sean.
--
(please remember to click yes if replies you receive are helpful to you)


"Chevy" wrote:

I am looking to copy and paste values using a macro. I am able the create
this macro but run into a problem when I need to click the macro button for
the next row. For example it will run for row3 but when i go to row4 it wont
run. I need the macro to run on the active row? Can anyone please help.