PDA

View Full Version : input button



keithpitts
06-12-2013, 12:19 PM
I have a workbook that has 3 work sheets.
1Keith’s April Monthly Budget
2 web Links
3 CT Scan
I created a Button go to a web site to pay a bill
This is it
Sub Macro8()
'
' Macro8 Macro
'

'
Sheets("Web Links").Select
Range("A11").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets("Keith's April Monthly Budget").Select
End Sub
In the’ CT Scan’ sheet I have 4 columns, Date “A4”, Owed”B4”,Balance Left “C4”,Payed this month “D4” and Payments Made “E4”
I need an input Button that will allow me to make a input box to make a payment of $25.00 or more and put it in the next blank box down from “D4” o by the way the column “Balance Left” is linked to
("Keith's April Monthly Budget")
:friends:

Doug Robbins
06-12-2013, 09:16 PM
Use the following code:

Dim i As Long
With Sheets("CT Scan").Range("A4")
i = .CurrentRegion.Rows.Count
.Offset(i, 3).Value = InputBox("Enter the Payment Amount.")
End With

keithpitts
06-13-2013, 03:48 AM
the input box shows ok but the value goes nowhere.
email me at keithpitts@hotmail.com
thanks
Keith

p45cal
06-13-2013, 05:58 AM
but the value goes nowhere.Oh it does… somewhere in column D. Anywhere from row 5, to 4 rows below any data in the sheet.
You could try this variant:Sub blah()
Dim i As Long
i = 4
With Sheets("CT Scan")
Do Until IsEmpty(.Cells(i, "D"))
i = i + 1
Loop
Application.Goto .Cells(i, "D") 'take this line out if you want - it only selects the cell where data will be placed so that the user can see it.
.Cells(i, "D").Value = InputBox("Enter the Payment Amount.")
End With
End Sub

keithpitts
06-14-2013, 08:33 AM
Thanks to p45cal And Doug Robbins For all the help on my button input problem. Sorry it took so long to get back to everyone, i had a problem getting it to work inside another macro, you know end sub, and all so.I can't say thanks enough.
Thanks Again
Keith Pitts:friends:
p.s. this was my first experience with VBA are there good books for Beginners. Thanks again with the help.

p45cal
06-14-2013, 08:38 AM
are there good books for Beginners. Thanks again with the help.try
Excel 2010 Power Programming with VBA
http://www.amazon.co.uk/Excel-Power-Programming-Spreadsheets-Bookshelf/dp/0470475358