View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
SeanC UK[_2_] SeanC UK[_2_] is offline
external usenet poster
 
Posts: 63
Default automated copy and past special feature

Hi Chevy,

I'm glad it helped.

I'm not sure if there are classes in VBA. I'd just play around with it, and
use the Help files as they give you a lot of information on objects, methods,
properties, functions etc. Record macros to get a flavour of what it is you
are trying to achieve, and then play with the code you just recorded it make
it more specific, or more flexible etc. There are plenty of books available
too, but I'd just start by playing around (well, actually I did!)

Also, just read the posts in here, basic computer programming techniques
will get you results, but there are many shortcuts specific to Excel that can
save a lot of processing time.

I'm sure we're all learning new stuff in here, and when we're not, they
simply create a newer version!

Cheers,

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


"Chevy" wrote:

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.