First Empty Cell in Found ROW

C

Coza

Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim rngFound As Range
On Error Resume Next
With Worksheets("Data").Range("A:A")
Set rngFound = .Find(What:=Me.TextBox1.Value, After:=.Cells(1),
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False)
' HOW CAN I FIND THE 1ST EMPTY ("") CELL IN THE rngfound.offset(0,x) ROW ?

' I want to place some Textbox values into the First Blank Cell in the Same
Row as the (RNGFOUND) but do not know how to Add this in.
' Say for instance: 1st Blank Cell in Row: textbxo1.value =
rngfound(0,ISEMPTY).value
' Other code here
Application.ScreenUpdating = True
End Sub

Corey....
 
S

Susan

corey
since you're going to be in column a, row rngfound.row,
if you then use

dim FirstBlank as range
set FirstBlank =
worksheets("Data").range(rngFound).end(xltoright).offset(0,1)
textbox1.value = firstblank

that will be the 1st empty cell in rngFound
but this will only work if it is TRULY empty, not just blank with a
formula in it.

this is untested but should get you started..........
hth
susan
 
C

Coza

Thanks
Susan said:
corey
since you're going to be in column a, row rngfound.row,
if you then use

dim FirstBlank as range
set FirstBlank =
worksheets("Data").range(rngFound).end(xltoright).offset(0,1)
textbox1.value = firstblank

that will be the 1st empty cell in rngFound
but this will only work if it is TRULY empty, not just blank with a
formula in it.

this is untested but should get you started..........
hth
susan
 

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

Top