Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Copy to next row down

Hi,
I have a macro that scrolls through a list of stores, pulling up data
regarding each particular store.
There are two different summary sheets, Summary1 and Summary2. In each
summary sheet Row 3 references other areas of the workbook and provides
different statistics for the particular store. I need the macro to copy row
3 in each sheet and paste it as a value to the first blank row after row 6,
then move on to the next store. The store looping is handled in the "other
code" listed below and that seems to be working. The section of code below
isn't copying and pasting as I was hoping. Is there a different way to write
it? Once again, I just want to copy row three (which changes with each
store) and paste it to row 6, 7, 8, 9 ....and so on--keeping in mind that I
need to do it in both summary sheets.



'other code.....
CopyToNext wksSummary
CopyToNext wksSummary2
'other code


Sub CopyToNext(wks As Worksheet)

Dim rngfill As Range

With wks
wksSummary.Outline.ShowLevels RowLevels:=2, ColumnLevels:=2
wksSummary.Calculate
Set rngfill = Nothing
Set rngfill = .Range("A" & .Rows.Count).End(xlUp)
Set rngfill = rngfill.Offset(1, 0)

Rows("3:3").Copy
rngfill.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

rngfill.PasteSpecial Paste:=xlFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Application.CutCopyMode = False
End With

End Sub


--
Thanks,
PTweety
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Copy to next row down

Please see the revised version of this posting.
--
Thanks,
PTweety


"pickytweety" wrote:

Hi,
I have a macro that scrolls through a list of stores, pulling up data
regarding each particular store.
There are two different summary sheets, Summary1 and Summary2. In each
summary sheet Row 3 references other areas of the workbook and provides
different statistics for the particular store. I need the macro to copy row
3 in each sheet and paste it as a value to the first blank row after row 6,
then move on to the next store. The store looping is handled in the "other
code" listed below and that seems to be working. The section of code below
isn't copying and pasting as I was hoping. Is there a different way to write
it? Once again, I just want to copy row three (which changes with each
store) and paste it to row 6, 7, 8, 9 ....and so on--keeping in mind that I
need to do it in both summary sheets.



'other code.....
CopyToNext wksSummary
CopyToNext wksSummary2
'other code


Sub CopyToNext(wks As Worksheet)

Dim rngfill As Range

With wks
wksSummary.Outline.ShowLevels RowLevels:=2, ColumnLevels:=2
wksSummary.Calculate
Set rngfill = Nothing
Set rngfill = .Range("A" & .Rows.Count).End(xlUp)
Set rngfill = rngfill.Offset(1, 0)

Rows("3:3").Copy
rngfill.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

rngfill.PasteSpecial Paste:=xlFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Application.CutCopyMode = False
End With

End Sub


--
Thanks,
PTweety

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
A visual basic value copy BUG?? - accounting format has copy problem!! [email protected] Excel Programming 3 June 20th 06 04:42 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
copy formulas from a contiguous range to a safe place and copy them back later Lucas Budlong Excel Programming 2 February 22nd 06 08:26 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM


All times are GMT +1. The time now is 05:48 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"