Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default results of a macro must be put in new row each time it is run

Each time I run the macro, it unfortunately puts the results of the macro in
the SAME row of the worksheet. How can I program the macro so that it will
put the results in a next unfilled row?
This way all my data will show and not overwritten by the macro.

Thanks!

Andrew
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default results of a macro must be put in new row each time it is run

Hi,

You didn't show us any code. So the general idea is to use something like

Range("C1").End(XLDown).Offset(1,0).Select

to find the first empty cell in column C (note this assumes you have data
in at least C1 and C2.

You can also find the first blank cell below the last cell with data with
Range("C65536").End(XLUp).Offset(1,0).Select

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"andrewc" wrote:

Each time I run the macro, it unfortunately puts the results of the macro in
the SAME row of the worksheet. How can I program the macro so that it will
put the results in a next unfilled row?
This way all my data will show and not overwritten by the macro.

Thanks!

Andrew

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default results of a macro must be put in new row each time it is run

Hello Shane,
thanks for you reply. I will now supply you with the code so that it is
more clear
what I need to do.

'
Windows("Copy of Master SO & PO List.xls").Activate
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 14
ActiveWindow.ScrollRow = 18
ActiveWindow.ScrollRow = 24
ActiveWindow.ScrollRow = 27
ActiveWindow.ScrollRow = 29
ActiveWindow.ScrollRow = 31
ActiveWindow.ScrollRow = 33
ActiveWindow.ScrollRow = 34
ActiveWindow.ScrollRow = 35
ActiveWindow.ScrollRow = 36
ActiveWindow.ScrollRow = 37
ActiveWindow.ScrollRow = 53
ActiveWindow.ScrollRow = 58
ActiveWindow.ScrollRow = 59
ActiveWindow.ScrollRow = 60
ActiveWindow.ScrollRow = 61
ActiveWindow.ScrollRow = 63
ActiveWindow.ScrollRow = 64
ActiveWindow.ScrollRow = 65
ActiveWindow.ScrollRow = 66
ActiveWindow.ScrollRow = 67
ActiveWindow.ScrollRow = 68
ActiveWindow.ScrollRow = 70
ActiveWindow.ScrollRow = 80
ActiveWindow.ScrollRow = 81
ActiveWindow.ScrollRow = 82
ActiveWindow.ScrollRow = 83
ActiveWindow.ScrollRow = 84
ActiveWindow.ScrollRow = 85
ActiveWindow.ScrollRow = 86
ActiveWindow.ScrollRow = 87
ActiveWindow.ScrollRow = 88
ActiveWindow.ScrollRow = 89
ActiveWindow.ScrollRow = 90
ActiveWindow.ScrollRow = 91
ActiveWindow.ScrollRow = 92
ActiveWindow.ScrollRow = 93
ActiveWindow.ScrollRow = 94
ActiveWindow.ScrollRow = 98
ActiveWindow.ScrollRow = 101
ActiveWindow.ScrollRow = 104
ActiveWindow.ScrollRow = 116
ActiveWindow.ScrollRow = 117
ActiveWindow.ScrollRow = 119
ActiveWindow.ScrollRow = 121
ActiveWindow.ScrollRow = 124
ActiveWindow.ScrollRow = 127
Range("A157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R3C3"
Range("B157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R4C3"
Range("C157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R18C4"
Range("D157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C1"
Range("E157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C5"
Range("F157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C6"
Range("G157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C7"
Range("J157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C10"
Range("K157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C11"
Range("L157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C2"
Range("M157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C3"
Range("N157").Select
ActiveCell.FormulaR1C1 = "='[Copy 2 of Prototype SO & PO.xls]PO Sheet
A'!R21C4"
Range("N158").Select
Windows("Copy 2 of Prototype SO & PO.xls").Activate
End Sub


"Shane Devenshire" wrote:

Hi,

You didn't show us any code. So the general idea is to use something like

Range("C1").End(XLDown).Offset(1,0).Select

to find the first empty cell in column C (note this assumes you have data
in at least C1 and C2.

You can also find the first blank cell below the last cell with data with
Range("C65536").End(XLUp).Offset(1,0).Select

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"andrewc" wrote:

Each time I run the macro, it unfortunately puts the results of the macro in
the SAME row of the worksheet. How can I program the macro so that it will
put the results in a next unfilled row?
This way all my data will show and not overwritten by the macro.

Thanks!

Andrew

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
Adding results from a If formula-Short in time Diana Excel Worksheet Functions 2 August 25th 08 02:36 AM
Different Results in each time I click on F9 Simone Excel Worksheet Functions 3 November 5th 07 07:59 PM
N/A results on vlookup with time calculations Freida Excel Worksheet Functions 4 October 22nd 07 06:09 PM
What is the formula to display a negative time results? Robluc65 Excel Worksheet Functions 1 October 14th 05 11:15 PM
macro results wrong Joseph Tibiita Charts and Charting in Excel 2 June 30th 05 05:32 PM


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