Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wally,
Small correction... Delete the "Exit Sub" line - 5th code line from bottom. Jim Cone "Jim Cone" wrote in message ... Wally, This should get you started... '---------------------------------- Sub DoNotRespondToUnsolicitedAdvertising() 'Jim Cone - December 27, 2004 Dim rngStart As Excel.Range Dim rngLast As Excel.Range Dim lngStartNum As Long 'Assumes correct cell is selected and a 'name is filled in to the left. lngStartNum = Val(VBA.InputBox(vbCr & "Enter the quantity", _ " Wally's List", "Be reasonable")) If Val(lngStartNum) 2 Then Set rngStart = ActiveCell rngStart.Value = lngStartNum rngStart(2, 1).Value = lngStartNum - 1 Else GoTo QuitHere End If Set rngLast = rngStart(lngStartNum, 1) Range(rngStart, rngStart(2, 1)).AutoFill _ Range(rngStart, rngLast) Range(rngStart, rngLast).Offset(0, -1).Value = _ rngStart(1, 0).Value Exit Sub '*** Delete this line QuitHe Set rngStart = Nothing Set rngLast = Nothing End Sub '-------------------------- Regards, Jim Cone San Francisco, USA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically filling a cell from a worksheet based on a selection | Excel Worksheet Functions | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
filling information from one cell and filling another. | Excel Worksheet Functions | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming | |||
Filling multiple cells based on 1 combo box selection | Excel Programming |