ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Do Loop (https://www.excelbanter.com/excel-programming/337770-do-loop.html)

BobBarker

Do Loop
 
I need help with the following VB Excel Do Loop Statement in a user form:
In lame men terms

Private Sub CommandButton1_Click()
Range = Row
Do while €˜the cell in row 1 is empty

If €˜the cell is empty then
Select the cell and drop Text Box1 information (From A User form) in to the
empty cell
(Like €œA10€ ) and Text Box2 Information into the cell next to it. (Like
€œB10€).
Else

Row +1

Loop

End if
End if

End Sub

Thank you very much for any Feedback. Please Also include, If okay, a E-Mail
Address for possible further


Tom Ogilvy

Do Loop
 
Private Sub CommandButton1_Click()
dim r as Long
r = 1
Do while Not isempty(cells(r,1))
r = r + 1
Loop
Cells(r,1) = Textbox1.Text
Cells(r,2) = Textbox2.Text

End Sub

--
Regards,
Tom Ogilvy


"BobBarker" wrote in message
...
I need help with the following VB Excel Do Loop Statement in a user form:
In lame men terms

Private Sub CommandButton1_Click()
Range = Row
Do while 'the cell in row 1 is empty

If 'the cell is empty then
Select the cell and drop Text Box1 information (From A User form) in to

the
empty cell
(Like "A10" ) and Text Box2 Information into the cell next to it. (Like
"B10").
Else

Row +1

Loop

End if
End if

End Sub

Thank you very much for any Feedback. Please Also include, If okay, a

E-Mail
Address for possible further




Charlie

Do Loop
 
Dim EmptyCell As Range

For Each EmptyCell In Range("1:1").Cells
If IsEmpty(EmptyCell) Then
Cells(EmptyCell.Row, EmptyCell.Column) = Textbox1.Text
Cells(EmptyCell.Row + 1, EmptyCell.Column) = Textbox2.Text
End If
Next EmptyCell


"BobBarker" wrote:

I need help with the following VB Excel Do Loop Statement in a user form:
In lame men terms

Private Sub CommandButton1_Click()
Range = Row
Do while €˜the cell in row 1 is empty

If €˜the cell is empty then
Select the cell and drop Text Box1 information (From A User form) in to the
empty cell
(Like €œA10€ ) and Text Box2 Information into the cell next to it. (Like
€œB10€).
Else

Row +1

Loop

End if
End if

End Sub

Thank you very much for any Feedback. Please Also include, If okay, a E-Mail
Address for possible further



All times are GMT +1. The time now is 11:59 PM.

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