PDA

View Full Version : Solved: can i use cell ref from a input box in this way?



jazznaura
12-17-2007, 11:30 AM
hi all,

i'm a newbie and was playing around with input boxes and wrote this little code but can't get it to work.

anyone tell me where i've gone wrong?
can i use cell ref from a input box in this way?

thanks



Sub inputcell()

Worksheets("sheet1").Activate

Set icell = Application.InputBox(prompt:="Please click on the Date to be worked", Title:="Please Select A Cell", Type:=8)

Set endcell = Application.InputBox(prompt:="Please click on the last cell to be worked", Title:="Please Select A Cell", Type:=8)

icell.Select

Selection.AutoFill Destination:=Range("icell:endcell"), Type:=xlFillDefault

Range("icell:endcell").Select

Range("A1").Select

End Sub

Bob Phillips
12-17-2007, 12:08 PM
Sub inputcell()

Worksheets("sheet1").Activate

Set icell = Application.InputBox(prompt:="Please click on the Date to be worked", Title:="Please Select A Cell", Type:=8)

Set endcell = Application.InputBox(prompt:="Please click on the last cell to be worked", Title:="Please Select A Cell", Type:=8)

icell.AutoFill Destination:=Range(icell, endcell), Type:=xlFillDefault

Range(icell, endcell).Select

Range("A1").Select

End Sub

jazznaura
12-17-2007, 12:13 PM
thanks xld,

i was nearly there.

cheers

jazznaura