Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default automated copy and past special feature

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default automated copy and past special feature

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default automated copy and past special feature

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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default automated copy and past special feature

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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
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.



  #6   Report Post  
Posted to microsoft.public.excel.programming
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Past Special- Transpose Function? Going Crazy with excel[_2_] Excel Discussion (Misc queries) 7 May 26th 10 12:36 AM
past special geb Excel Worksheet Functions 2 June 2nd 09 03:39 AM
Past Special Concatenated formula Don Excel Discussion (Misc queries) 7 December 11th 07 09:20 AM
Uniform and automated save feature... for excel (or word templates SooHunter Setting up and Configuration of Excel 3 October 6th 07 12:01 AM
Past Special changes results for macros... how to prevent this Matt[_33_] Excel Programming 1 September 30th 05 10:14 PM


All times are GMT +1. The time now is 03:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"