View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default First Empty Cell in Found ROW

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


On Mar 20, 8:14 am, "Coza" wrote:
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....