Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 791
Default Excel Macro

Hi,
I have a regular task that I do on a pivottable that looks like this (but
longer):

No Code Total
1 DN 841.92
PRP08 0
PRP30 0
2 RDB 0.00
RTQ 0.00
RVW 15,636.98
3 PRP42 3,435.76
Grand Total 672,328.19

I paste this info into a database which requires the number to be repeated
on each line.

At the moment I use a macro to copy the data down to the next entry as shown
below starting in the cell that has No in:
Selection.End(xlDown).Select
Selection.End(xlDown).Select
ActiveCell.Offset(-1, 0).Select
Range(Selection, Selection.End(xlUp)).Select
Selection.filldown

and in the macro the above code is repeated 4 times and I keep repeating the
macro until it gets near to the end of the list.

Ideally I would like the macro to continue repeating the code above until it
gets to the grand total row and then stop.
I am sure this could be done using a "Do while" or similar statement. Could
anyone help please?

Thanks.






 
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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM
Macro - Open Word with Excel macro Bill Excel Discussion (Misc queries) 3 May 23rd 05 11:21 PM


All times are GMT +1. The time now is 02:47 PM.

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

About Us

"It's about Microsoft Excel"