#1   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default search for next row

I would like to have a macro that searches the range Say A10:A15 if
there is a value in A10 then goto B10 do what I have to do in a
userform then click ok, then it goes to see if there is a value in the
next row

  #2   Report Post  
Posted to microsoft.public.excel.misc
Tom Ogilvy
 
Posts: n/a
Default search for next row

for each cell in range("A10:A15")
if isempty(cell) then cell.offset(0,1).Select
userform1.show
end if
Next

--
Regards,
Tom Ogilvy

"damorrison" wrote in message
oups.com...
I would like to have a macro that searches the range Say A10:A15 if
there is a value in A10 then goto B10 do what I have to do in a
userform then click ok, then it goes to see if there is a value in the
next row



  #3   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default search for next row

Thanks alot, what is the opposite of
IsEmpty
right now the macro stops at the first empty row
I need it to stop at the next row with a value in the A10:A15 range

  #4   Report Post  
Posted to microsoft.public.excel.misc
JimMay
 
Posts: n/a
Default search for next row

Not IsEmpty


"damorrison" wrote in message
oups.com:

Thanks alot, what is the opposite of
IsEmpty
right now the macro stops at the first empty row
I need it to stop at the next row with a value in the A10:A15 range


  #5   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default search for next row

This what I am trying to do

For Each cell In Range("A10:A15")
If Not IsEmpty(cell) Then
cell.Offset(0, 1).Select
Application.SendKeys "%{down}"
End If
Next

when a selection is made in colmn B the userform shows



  #6   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default search for next row

now it stops at the last cell

  #7   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default search for next row

something like this?

Dim r As Integer
r = ActiveCell.Row + 1
Do While (r <= 15)
If Not IsEmpty(Range("A" & r)) Then
Range("B" & r).Select
Application.SendKeys "%{down}"
Exit Do
End If
r = r + 1
Loop
The loop stops at row 15

  #8   Report Post  
Posted to microsoft.public.excel.misc
damorrison
 
Posts: n/a
Default search for next row

Hi Paul,

Yes that's it,
Thanks alot

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
How do i build a search table in excel Obi-Wan Kenobi Excel Worksheet Functions 2 March 20th 06 03:20 PM
build a search tool in excel Obi-Wan Kenobi Excel Discussion (Misc queries) 1 March 18th 06 03:21 PM
Search open sheets in workbook and insert into open sheet punx77 Excel Discussion (Misc queries) 0 March 6th 06 05:07 PM
Search Entire Workbook Sloth Excel Discussion (Misc queries) 0 October 14th 05 05:12 AM
FAQ Spreadsheet with search function murphyz Excel Discussion (Misc queries) 0 March 19th 05 09:24 PM


All times are GMT +1. The time now is 12:57 PM.

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"