Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default First Empty Cell in Found ROW

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....


  #2   Report Post  
Posted to microsoft.public.excel.programming
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....



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default First Empty Cell in Found ROW

Thanks
"Susan" wrote in message
oups.com...
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....





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
VBA HELP - DO UNTIL EMPTY ROW FOUND Sally Excel Discussion (Misc queries) 2 June 12th 06 03:50 PM
Leaving an empty cell empty GRL Excel Discussion (Misc queries) 4 April 22nd 06 05:47 PM
why a reference to an empty cell is not considered empty Nicoscot Excel Discussion (Misc queries) 10 March 10th 06 05:36 AM
Finding next empty empty cell in a range of columns UncleBun Excel Programming 1 January 13th 06 11:22 PM


All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"