Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Limit Find to a single column


Hi,

I am attempting to limit a find function to the single colum J,
starting in row 2 and searching until there is a blank cell in the
column or until the search has reached its logical conclusion (i.e. it
has searched every filled cell in that column). I would prefer the
latter but would be satisfied with either.

Thanks


--
merritts
------------------------------------------------------------------------
merritts's Profile: http://www.excelforum.com/member.php...o&userid=35803
View this thread: http://www.excelforum.com/showthread...hreadid=558592

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Limit Find to a single column

Hi Merritts,

Try:

'=============
Public Sub Testerw001()
Dim rng As RangeConst col As Long ="J"

On Error Resume Next
Set rng = Columns(col).SpecialCells(xlBlanks)(1)
On Error GoTo 0

If Not rng Is Nothing Then
'do something, e.g.:
MsgBox rng.Address
Else
MsgBox "No blank cells found in stipulated range"
End If
End Sub
'<<=============


--
---
Regards,
Norman



"merritts" wrote in
message ...

Hi,

I am attempting to limit a find function to the single colum J,
starting in row 2 and searching until there is a blank cell in the
column or until the search has reached its logical conclusion (i.e. it
has searched every filled cell in that column). I would prefer the
latter but would be satisfied with either.

Thanks


--
merritts
------------------------------------------------------------------------
merritts's Profile:
http://www.excelforum.com/member.php...o&userid=35803
View this thread: http://www.excelforum.com/showthread...hreadid=558592



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Limit Find to a single column

Were you hoping to do something with all of the hits, or just the first hit,
or just the last hit, or... Is your search case sensitive. What do you plan
on doing with the hit(s)...
--
HTH...

Jim Thomlinson


"merritts" wrote:


Hi,

I am attempting to limit a find function to the single colum J,
starting in row 2 and searching until there is a blank cell in the
column or until the search has reached its logical conclusion (i.e. it
has searched every filled cell in that column). I would prefer the
latter but would be satisfied with either.

Thanks


--
merritts
------------------------------------------------------------------------
merritts's Profile: http://www.excelforum.com/member.php...o&userid=35803
View this thread: http://www.excelforum.com/showthread...hreadid=558592


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Limit Find to a single column

Hi Merritts,

The code was intended as:

'=============
Public Sub Tester()
Dim rng As Range
Const col As String = "J"

On Error Resume Next
Set rng = Columns(col).SpecialCells(xlBlanks)(1)
On Error GoTo 0

If Not rng Is Nothing Then
'do something, e.g.:
MsgBox rng.Address
Else
MsgBox "No blank cells found in stipulated range"
End If
End Sub
'<<=============


---
Regards,
Norman


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Limit Find to a single column

Hi Merritts,

Re-reading your question, in response to Jim's questions, it is apparent
that I have misunderstood your requirements.

My code returns the first blank cell in column J, which is not what you
asked, so apologies and disregard my post.


---
Regards,
Norman




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Limit Find to a single column


First, Thanks for all your help. I really appreciate it.

I will be taking values from another workbook in column G the
searching column J for that value. If the value (an alpha-numeri
combination) match the F columns (only numeric) will be summed. Ther
should only be one match in that column, but not the spreadsheet as
whole. That is why i would like to limit it to one column

--
merritt
-----------------------------------------------------------------------
merritts's Profile: http://www.excelforum.com/member.php...fo&userid=3580
View this thread: http://www.excelforum.com/showthread.php?threadid=55859

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Limit Find to a single column


Thanks for all your help, i appreciate it.

The search will not be case sensitive and there should only be one hi
in the column. If there is more than one hit I would like there to b
an error message, but that may be beyond my immediate concerns for now


The larger idea behind the question is a search and update between tw
spreadsheets. I am hoping to write a macro that will select the firs
alpha-numeric name from spreadsheetB in column G. The macro will the
search spreadsheetA, column J for the alpha-numeric name. Once it ha
been located, values from their respective rows will b
summed/differenced. For example, AAAA#### from G3 (spreadsheetB) is th
first item. The macro would then search column J for AAAA####. Onc
found (for example in J50), the value located in F3 (spreadsheetB) wil
be added/subtracted from F50 (spreadsheetA).

The process would begin again at G4 and continue till spreadsheetB wa
complete.

I hope that helps

--
merritt
-----------------------------------------------------------------------
merritts's Profile: http://www.excelforum.com/member.php...fo&userid=3580
View this thread: http://www.excelforum.com/showthread.php?threadid=55859

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Limit Find to a single column

I am still a little vague on exactly what you wnat but give this a try...

Sub test()
Dim rng As Range

Set rng = FindStuff("A3B")
If Not rng Is Nothing Then MsgBox rng.Address
Set rng = FindStuff("A30B")
If Not rng Is Nothing Then MsgBox rng.Address

End Sub

Public Function FindStuff(ByVal strTofind As String) As Range
Dim rngToSearch As Range
Dim wksToSearch As Worksheet

Set wksToSearch = Sheets("Sheet1")
With wksToSearch
Set rngToSearch = .Range(.Range("J2"), .Cells(Rows.Count, "J").End(xlUp))
End With
Set FindStuff = rngToSearch.Find(What:=strTofind, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
MatchCase:=False)
End Function
--
HTH...

Jim Thomlinson


"merritts" wrote:


First, Thanks for all your help. I really appreciate it.

I will be taking values from another workbook in column G then
searching column J for that value. If the value (an alpha-numeric
combination) match the F columns (only numeric) will be summed. There
should only be one match in that column, but not the spreadsheet as a
whole. That is why i would like to limit it to one column.


--
merritts
------------------------------------------------------------------------
merritts's Profile: http://www.excelforum.com/member.php...o&userid=35803
View this thread: http://www.excelforum.com/showthread...hreadid=558592


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
Find duplicate emails within a single Excel column TClark Excel Worksheet Functions 0 April 28th 10 09:15 PM
Find & Replace - Limit search to a specific column falena23 Excel Worksheet Functions 3 July 28th 08 03:46 PM
Search Column - Find Multiple Entries - Sum Then Delete to Single Entry Ledge Excel Programming 5 June 19th 06 08:25 PM
Find Multiple instances of Single Criterion in Row & Return To a Single Col Sam via OfficeKB.com Excel Worksheet Functions 16 May 10th 06 03:00 AM
Find first blank cell in single column named range tig Excel Programming 9 February 9th 06 05:39 PM


All times are GMT +1. The time now is 05:49 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"