Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default How to find the addresses?

How do I find the addresses for the ranges of B column to D column for
each group in column A using VBA? For abc, I want to find B1:D3; for
efg, find B4:D9 and etc.

A B C D
1 abc 35000 23920 30780
2 abc 36975 23620 26799
3 abc 31800 28315 21528
4 efg 33863 24128 23400
5 efg 38213 23650 18720
6 efg 24000 41278 30600
7 efg 30000 32000 24794
8 efg 27583 26520 27405
9 efg 34000 33140 36627
10 xyz 30900 27192 29781
11 xyz 27600 25000 41000
12 opq 28912 32500 20801
13 opq 21936 20500 40174
14 opq 38000 16641 21840
15 opq 26499 24500 24516
....
....

I appreciate your help. Thanks.

Faye Larson

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to find the addresses?

Sub ShowRanges()
Dim rStart as Range, i as Long
Dim grp as String, rng as Range
set rStart = Range("A1")
grp = rStart.Value
i = 2
do while cells(i-1,1) < ""
if cells(i,1) < grp then
set rng = range(rStart,cells(i-1,4))
msgbox grp & " address is " & rng.Address(0,0)
set rStart = cells(i,1)
grp = rStart.Value
end if
i = i + 1
Loop
End Sub

Might be a start.

--
Regards,
Tom Ogilvy

"Faye" wrote:

How do I find the addresses for the ranges of B column to D column for
each group in column A using VBA? For abc, I want to find B1:D3; for
efg, find B4:D9 and etc.

A B C D
1 abc 35000 23920 30780
2 abc 36975 23620 26799
3 abc 31800 28315 21528
4 efg 33863 24128 23400
5 efg 38213 23650 18720
6 efg 24000 41278 30600
7 efg 30000 32000 24794
8 efg 27583 26520 27405
9 efg 34000 33140 36627
10 xyz 30900 27192 29781
11 xyz 27600 25000 41000
12 opq 28912 32500 20801
13 opq 21936 20500 40174
14 opq 38000 16641 21840
15 opq 26499 24500 24516
....
....

I appreciate your help. Thanks.

Faye Larson


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 Range Borders (Cell Addresses) In VBA FARAZ QURESHI Excel Discussion (Misc queries) 8 May 16th 09 06:16 AM
odd and even addresses Dino Excel Worksheet Functions 3 September 30th 08 05:47 PM
Addresses Oggy Excel Discussion (Misc queries) 1 April 7th 07 02:02 PM
Help with Addresses kimbiak21 New Users to Excel 8 April 13th 06 10:54 PM
Lookup function to find email addresses Michael McClellan Excel Programming 1 June 11th 04 09:59 PM


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