Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Alright here's the deal. I have a sheet that has a list of items,
quantities, unit price and extended price. Right now they are numbered 1-20 but they are on row 11 - 30. You can see a screen shot here to see what i mean http://img134.imageshack.us/img134/2361/excelh.jpg Well anyways, i want to see if anybody knows how i would be able to insert a new line and put the corresponding number in there. So lets say for instance i need 50 items instead of only 20. I wanted to see if anybody knows how i would be able to write a macro where it will automatically add new lines below 20, and go all the way through 50. So after running the macro it will go from only being 20 to being 50 or however many items are needed. This will help me out a very lot and save me a lot of time if someone might be able to assist me with this. Thank you for your time and help. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This little macro will do the job...
Sub test() Cells(31, 1).Select For i = 50 To 21 Step -1 ActiveCell.EntireRow.Insert ActiveCell.Value = i Next End Sub -- -------- If this is what you wanted then press the ''''YES'''' button (if you see it) "tripflex" wrote: Alright here's the deal. I have a sheet that has a list of items, quantities, unit price and extended price. Right now they are numbered 1-20 but they are on row 11 - 30. You can see a screen shot here to see what i mean http://img134.imageshack.us/img134/2361/excelh.jpg Well anyways, i want to see if anybody knows how i would be able to insert a new line and put the corresponding number in there. So lets say for instance i need 50 items instead of only 20. I wanted to see if anybody knows how i would be able to write a macro where it will automatically add new lines below 20, and go all the way through 50. So after running the macro it will go from only being 20 to being 50 or however many items are needed. This will help me out a very lot and save me a lot of time if someone might be able to assist me with this. Thank you for your time and help. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
What about if i want to keep the information in those cells to have it repeat
whenever it creates a new one, and so that it goes up in numbers, like the first one it would make the first cell would be 21, then 22, then 23, etc ,etc Thanks! "Sheeloo" wrote: This little macro will do the job... Sub test() Cells(31, 1).Select For i = 50 To 21 Step -1 ActiveCell.EntireRow.Insert ActiveCell.Value = i Next End Sub -- -------- If this is what you wanted then press the ''''YES'''' button (if you see it) "tripflex" wrote: Alright here's the deal. I have a sheet that has a list of items, quantities, unit price and extended price. Right now they are numbered 1-20 but they are on row 11 - 30. You can see a screen shot here to see what i mean http://img134.imageshack.us/img134/2361/excelh.jpg Well anyways, i want to see if anybody knows how i would be able to insert a new line and put the corresponding number in there. So lets say for instance i need 50 items instead of only 20. I wanted to see if anybody knows how i would be able to write a macro where it will automatically add new lines below 20, and go all the way through 50. So after running the macro it will go from only being 20 to being 50 or however many items are needed. This will help me out a very lot and save me a lot of time if someone might be able to assist me with this. Thank you for your time and help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inserting lines throughout a spreadsheet | Excel Worksheet Functions | |||
Inserting # of lines from one spreadsheet to another | Excel Discussion (Misc queries) | |||
Inserting Lines or Copying lines with formulas but without data | Excel Discussion (Misc queries) | |||
Separate Groups by Inserting Lines | Excel Discussion (Misc queries) | |||
Code for Inserting Multiple lines | Excel Discussion (Misc queries) |