LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Macro: copying, inserting & autofilling.

'Scuse the length of this post I wanted to cover everything as
completely as possible to save people having to ask extra info.

I have a sheet which intermittently gets external data. This data is
then manually inserted into another sheet which has calculations to
the right of the data. The manual process takes the form:

1) In column A of the "old" data is a record number, so find
that;
2) Look on the new data (the one that was returned from the Get
External data feature); find how many records need to be copied (i.e.
are NOT in the "old" data)
3) from new data, copy (and then paste into the "old" data) the
new records
4) use the fill-handle to fill up the rows (to row 3, where the
data ends) the formulas from columns J to AH

Here is an abbreviated version of the data:-

"OLD" DATA
1115 19/07/2006 Mike Laura Calculations are here (down
columns and across to row AH)
1116 17/07/2006 Tony Emma
1117 13/07/2006 Peter Jim
1118 19/07/2006 Tracey Steve
1119 17/07/2006 Karen Lenny
1120 13/07/2006 Andy Susan
1121 19/07/2006 Luke Carol
1122 17/07/2006 Pippa Alice
1123 13/07/2006 Debbie James

"NEW" DATA
1111 08/08/2006 Amy Sean
1112 06/08/2006 Zoe Paul
1113 04/08/2006 Eve Matt
1114 02/08/2006 Troy Richard
1115 31/07/2006 Mike Laura
1116 29/07/2006 Tony Emma
1117 27/07/2006 Peter Jim
1118 25/07/2006 Tracey Steve
1119 23/07/2006 Karen Lenny
1120 21/07/2006 Andy Susan
1121 19/07/2006 Luke Carol
1122 17/07/2006 Pippa Alice
1123 13/07/2006 Debbie James

I have created the following macro on some dummy data, but it needs
some refining (see my thoughts below the code)

Sub Macro1()
Sheets("New Data").Select
Rows("3:6").Select
Selection.Copy
Sheets("Old Data").Select
Rows("3:3").Select
Selection.Insert Shift:=xlDown
Range("E3").Select ' This is the first cell to the right of the
data that has a calculation in it.
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("E3:AH7"),
Type:=xlFillDefault
Range("A1").Select
End Sub

The parts I require help with a

1) Finding how many rows to copy from the New data;
2) On the "Old Data" once the new dta is inserted, finding the cell
with the first calculation to the right and filling it up to row 3.

Any help/suggestions much appreciated


Steve


 
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
inserting special character in a cell as a macro johnnyboy New Users to Excel 3 September 11th 06 09:05 PM
how do I email amacro? leo Excel Worksheet Functions 24 August 9th 06 02:47 PM
Macro Help In Excel welshlad Excel Discussion (Misc queries) 14 October 26th 05 02:34 PM
copying text into a macro pagelocator Excel Worksheet Functions 1 November 24th 04 08:52 AM
Inserting Blank Rows Macro? Michael Saffer Excel Worksheet Functions 2 November 9th 04 06:23 PM


All times are GMT +1. The time now is 08:31 PM.

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"