Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default how to search the upper and lower of a range

I want to search the upper and lower row of a range.
for example,
Range("B3:E10")
Upper = "B"
Lower = "E"

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default how to search the upper and lower of a range

Why? There are usually much better ways of doing this rather than get the
letters. Explain the problem, maybe there is a better solution.


Sub test()

Set MyRange = Range("B3:E10")
FirstColNum = MyRange.Column
FirstColLetter = MyRange.Address
'remove $ sign
FirstColLetter = Mid(FirstColLetter, 2)
'remove rest of string, look for $
FirstColLetter = Left(FirstColLetter, InStr(FirstColLetter, "$") - 1)

SecondColNum = MyRange.Column + MyRange.Columns.Count - 1
SecondColLetter = MyRange.Address
'remove everything before colon
SecondColLetter = Mid(SecondColLetter, InStr(SecondColLetter, ":") + 1)
'remove $ sign
SecondColLetter = Mid(SecondColLetter, 2)
'remove rest of string, look for $
SecondColLetter = Left(SecondColLetter, InStr(SecondColLetter, "$") - 1)

End Sub

"leungkong" wrote:

I want to search the upper and lower row of a range.
for example,
Range("B3:E10")
Upper = "B"
Lower = "E"

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default how to search the upper and lower of a range

leungkong wrote:
I want to search the upper and lower row of a range.
for example,
Range("B3:E10")
Upper = "B"
Lower = "E"

Thanks.

What do you mean you want to "search it"? Loop through it? Find a
specific value in it? Something else?

Alan Beban
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
Changing numerical values based upper and lower range jrmcosmo Excel Discussion (Misc queries) 4 September 22nd 09 04:58 PM
convert lower to upper case automatically without using UPPER Sal Excel Discussion (Misc queries) 6 July 26th 09 11:27 AM
Changing upper case characters to upper/lower Richard Zignego Excel Discussion (Misc queries) 1 December 17th 07 10:09 PM
Change from mixed caps and upper lower to all upper lower case Fish''s Mermaid Excel Worksheet Functions 3 October 13th 06 02:15 PM
How do I convert all upper case excel sheet into upper and lower . DebDay Excel Discussion (Misc queries) 1 March 9th 05 08:31 PM


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