ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to input data (https://www.excelbanter.com/excel-programming/278458-macro-input-data.html)

glenn[_2_]

macro to input data
 
Hi
I need to know if what command is required to a make macro
that will ask the user to input data and then after
entering it will move to the next cell again asking the
user to input another data.

Glenn


merjet

macro to input data
 
Assuming entry is prompted by a
CommandButton:

Private Sub CommandButton1_Click()
Dim strIn As String
Do
strIn = InputBox("Enter data.")
iRow = iRow + 1
Sheets("Sheet1").Cells(iRow, 1) = strIn
Loop Until strIn = ""
End Sub

HTH,
Merjet




All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com