Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try This
Sub InputIncTon() Dim IsIniit As String IsInit = InputBox("What is the INC/TON?", "INC/TON") ' IsEmpty is Boolean, returns True if variable 'is initialised, False if not. If IsEmpty(IsInit) = False Then Worksheets("Credits").Range("G4:G600").Value = IsInit End If End Sub Subodh "cottage6" wrote in message ... Of course! The solution always looks so easy after it's presented to me line by line, until the next time I need to come up with something. Thanks for your help and have a good day. "Jim Thomlinson" wrote: Try this... Sub InputIncTon() dim strAnswer as string strAnswer = InputBox("What is the INC/TON?", "INC/TON") if stranswer < "" then Worksheets("Credits").Range("G4:G600").value = stranswer end if End Sub -- HTH... Jim Thomlinson "cottage6" wrote: Hi All, I'm sure this is an easy question for most, except for me! I have an InputBox that gets a value and then copies the number down. Numbers will already be in the column from the prior week, and could be used again. However, if the user invokes the macro by mistake and then clicks "Cancel" the first entry gets wiped out. I'm pretty sure I could get around this, but I really want the correct way of doing this. Enclosed is my ratty code; help would be much appreciated! Sub InputIncTon() Sheets("Credits").Select Range("G4").Select ActiveCell = InputBox("What is the INC/TON?", "INC/TON") If ActiveCell = "" Then GoTo GetMeOuttaHere With Worksheets("Credits") .Range("G4:G600").FillDown End With GetMeOuttaHe End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
InputBox with VBA | Excel Discussion (Misc queries) | |||
InputBox | Excel Discussion (Misc queries) | |||
InputBox help please | Excel Programming | |||
inputbox | Excel Discussion (Misc queries) | |||
Inputbox and Application.InputBox | Excel Programming |