Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Returning results to multiple location using VBA?

Thanks for the help in advance!! The macro below compares data from a
range and lists all the possible permutations (combinations) of the
data.

EXAMPLE...the range of:

Price
MGP
Comfort
Style

will return this data:

Price <compared to MGP
Price <compared to Comfort
Price <compared to Style
MGP <compared to Comfort
MGP <compared to Style
Comfort <compared to Style


How can I alter the macro to ALSO return the data to another sheet and
aranged in a table?

EXAMPLE:

Price MGP Comfort Style
Price
MGP
Comfort
Style


Here is macro:

abc()
Dim rw As Long, i As Long, j As Long
Dim lb As Long, ub As Long
Dim rng As Range, icol As Long
Set rng = Range("c7:c10")
lb = rng(1).Row
ub = rng(rng.Count).Row
icol = rng.Column
rw = 6
For i = lb To ub
For j = i + 1 To ub
If StrComp(Cells(i, icol), Cells(j, icol), _
vbTextCompare) < 0 Then
rw = rw + 1
Cells(rw, icol + 1) = Cells(i, icol) & " <compared to
" & Cells(j, icol)
End If
Next
Next

End Sub

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
MULTIPLE CRITERIA RETURNING SUM OF RESULTS [email protected] Excel Worksheet Functions 5 November 15th 06 06:21 PM
MULTIPLE CRITERIA RETURNING SUM OF RESULTS [email protected] Excel Worksheet Functions 0 November 15th 06 05:11 PM
Lookup Returning Multiple Results joe1182 Excel Discussion (Misc queries) 5 February 1st 06 12:02 PM
Returning the location Rain Excel Programming 1 January 17th 05 09:07 PM
Macro Questions: Returning multiple results, description of parameter syntax et al. Frederik Romanov Excel Programming 1 July 17th 03 04:42 PM


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