Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am working on some code with Excel 2000 VBA and Microsoft
Windows 2000. I want to do a textbox prompt, get a number and insert the amount of rows that the user selects. Here's what I have, but it only inserts one line, no matter how many rows the user tells it: ' code starts here Dim answer, counter as integer inputbox "How many rows would you like to insert?", answer For counter = 0 to answer activecell.entirerow.insert next counter ' code ends here |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub GiveMeMore() Dim strAnswer As String Dim counter As Integer strAnswer = InputBox("How many rows would you like to insert?", "How Many", 1) If Len(strAnswer) 0 Then If Val(strAnswer) 0 Then For counter = 1 To Val(strAnswer) ActiveCell.EntireRow.Insert Next 'counter End If End If End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Larry D" wrote in message I am working on some code with Excel 2000 VBA and Microsoft Windows 2000. I want to do a textbox prompt, get a number and insert the amount of rows that the user selects. Here's what I have, but it only inserts one line, no matter how many rows the user tells it: ' code starts here Dim answer, counter as integer inputbox "How many rows would you like to insert?", answer For counter = 0 to answer activecell.entirerow.insert next counter ' code ends here |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert rows in locked worksheet - from Excel 2003 to 2000 | Excel Discussion (Misc queries) | |||
Imported into Vista, how to delete 2000 Excel textbox? | Excel Discussion (Misc queries) | |||
Insert Textbox values to seperate rows/columns | Excel Programming | |||
Removing textbox padding, how to please, Excel 2000/2003 | Excel Programming | |||
Help needed with textbox formatting in Excel 2000 | Excel Discussion (Misc queries) |