Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Help...

I had another question.I have a column named ItemNos..this colum
contains item numbers.Now,after every item number ,i need to inser
three rows containing the text value 'Actual','Forecast' AND 'Variance
in the same column..this shud however go until the range of the ite
nos..since sometimes the report spools 15 rows while at other times i
may spool 15000 rows...

Item Number
A
F
V
Item Number
A
F
V
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Macro Help...

Here is a stab at it ...
Sub Macro2()
[A1].Select 'This would be the first cell in your ItemNos. column
Do While ActiveCell.Value < ""
Range(ActiveCell.Offset(1, 0).Address & ":" & ActiveCell.Offset(3,
0).Address).EntireRow.Insert
ActiveCell.Offset(1, 0) = "A"
ActiveCell.Offset(2, 0) = "F"
ActiveCell.Offset(3, 0) = "V"
ActiveCell.Offset(4, 0).Select
Loop
End Sub

Now if you are really getting 15000 rows, what about 16000? If you
go over 16384 rows, that is more rows than allowed on an excel sheet.

-Tim

"sameer27p " wrote in message
...
I had another question.I have a column named ItemNos..this column
contains item numbers.Now,after every item number ,i need to insert
three rows containing the text value 'Actual','Forecast' AND 'Variance'
in the same column..this shud however go until the range of the item
nos..since sometimes the report spools 15 rows while at other times it
may spool 15000 rows...

Item Number
A
F
V
Item Number
A
F
V



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Macro Help...

Try this idea. Put Actual in g11, Forecast in g12, and Variance in g13 of
another sheet and use

Sub insert()
x = Cells(Rows.Count, "a").End(xlUp).Row
For i = x To 1 Step -1
Sheets("sheet1").Range("g11:g13").Copy
Cells(i, "a").Offset(1).insert shift:=xlDown
Next
End Sub

--
Don Guillett
SalesAid Software

"sameer27p " wrote in message
...
I had another question.I have a column named ItemNos..this column
contains item numbers.Now,after every item number ,i need to insert
three rows containing the text value 'Actual','Forecast' AND 'Variance'
in the same column..this shud however go until the range of the item
nos..since sometimes the report spools 15 rows while at other times it
may spool 15000 rows...

Item Number
A
F
V
Item Number
A
F
V



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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


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