PC Review


Reply
Thread Tools Rate Thread

Copy to next row down

 
 
pickytweety
Guest
Posts: n/a
 
      13th Apr 2009
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 With Quote
 
 
 
 
pickytweety
Guest
Posts: n/a
 
      13th Apr 2009
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
http://LongPathTool.com - find and delete/copy path too long filesfrom your hard drive or LAN Windows tool to copy or delete files and folderswith path too long or filename too long error. Just browse to the file andpress a button to copy or d Martin Krag Windows XP Internet Explorer 0 22nd Apr 2011 10:08 AM
http://LongPathTool.com - find and delete/copy path too long filesfrom your hard drive or LAN Windows tool to copy or delete files and folderswith path too long or filename too long error. Just browse to the file andpress a button to copy or d Martin Krag Windows XP Configuration 0 22nd Apr 2011 10:05 AM
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Microsoft Windows 2000 Active Directory 1 17th Feb 2009 01:31 PM
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Windows Vista General Discussion 2 17th Feb 2009 01:31 PM
EXCEL FILE a copy/a copy/a copy ....filename =?Utf-8?B?dmU=?= Microsoft Excel New Users 1 29th Sep 2005 09:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 AM.