Value of last row record

  • Thread starter Thread starter gregork
  • Start date Start date
G

gregork

Hi
On a user form I want a text box value to be the last value in a row of a
worksheet. i.e.

Private Sub UserForm_Initialize()
Me.TextBox1.Value = Sheets("Blend Sheet").Range ("B3:B500").Text' Last
Row'

How do I change the code to achieve this?

Regards
gregorK
 
Hi
try
Me.TextBox1.Value = Sheets("Blend Sheet").Cells(Rows.count,
"B").End(xlUp).value
 
Hi gregork

You can use the special cells function like Me.TextBox1.Value = Sheets.Cells.SpecialCells(xlCellTypeLastCell).value just make sure that the last cell to be edited is the cell that contains the value that you want. If you press CTRL + END will indicate what the xlCellTypeLastCell is

cia
K
----- gregork wrote: ----

H
On a user form I want a text box value to be the last value in a row of
worksheet. i.e

Private Sub UserForm_Initialize(
Me.TextBox1.Value = Sheets("Blend Sheet").Range ("B3:B500").Text' Las
Row

How do I change the code to achieve this

Regard
gregor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top