ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   First blank cell (https://www.excelbanter.com/excel-programming/403645-first-blank-cell.html)

Axel

First blank cell
 
I have made a userform that return back values from a sheet, and is
textboxes to give new values to the same sheet.
My problem is to make the textbox3 (Last line) to choose the first blank
cell to the right each time i open the userform.

Any suggestions?
Thanks

Private Sub ComboBox1_Change()
Dim iCtr As Integer

ictl = ComboBox1.Value
UserForm1.Label1 = Sheet2.Range("B" & CStr(2 + ictl))
UserForm1.Label17 = Sheet2.Range("C" & CStr(2 + ictl))
UserForm1.Label4 = Sheet1.Range("B" & CStr(2 + ictl))
UserForm1.Label5 = Sheet1.Range("D" & CStr(2 + ictl))
UserForm1.Label6 = Sheet1.Range("E" & CStr(2 + ictl))
UserForm1.Label13 = Sheet1.Range("C" & CStr(2 + ictl))

TextBox1.Text = Sheet2.Range("C" & CStr(2 + ictl))
TextBox2.Text = Sheet2.Range("D" & CStr(2 + ictl))
TextBox3.Text = Sheet2.Range("E" & CStr(2 + ictl +
Cells(Columns.Count).End(xlToLeft)(2, 1)))


*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips

First blank cell
 
Something like

ictl = Activeworkbook.Worksheets("Sheet1").End(xlDown).Ro w + 1

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Axel" wrote in message
...
I have made a userform that return back values from a sheet, and is
textboxes to give new values to the same sheet.
My problem is to make the textbox3 (Last line) to choose the first blank
cell to the right each time i open the userform.

Any suggestions?
Thanks

Private Sub ComboBox1_Change()
Dim iCtr As Integer

ictl = ComboBox1.Value
UserForm1.Label1 = Sheet2.Range("B" & CStr(2 + ictl))
UserForm1.Label17 = Sheet2.Range("C" & CStr(2 + ictl))
UserForm1.Label4 = Sheet1.Range("B" & CStr(2 + ictl))
UserForm1.Label5 = Sheet1.Range("D" & CStr(2 + ictl))
UserForm1.Label6 = Sheet1.Range("E" & CStr(2 + ictl))
UserForm1.Label13 = Sheet1.Range("C" & CStr(2 + ictl))

TextBox1.Text = Sheet2.Range("C" & CStr(2 + ictl))
TextBox2.Text = Sheet2.Range("D" & CStr(2 + ictl))
TextBox3.Text = Sheet2.Range("E" & CStr(2 + ictl +
Cells(Columns.Count).End(xlToLeft)(2, 1)))


*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 01:12 AM.

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