LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Perform compare of multiple selected columns

Hi

This should get you started:

Sub aaa()
For Each col In Selection.Columns
c = c + 1
Select Case c
Case 1
col1 = col.Column
Case 2
col2 = col.Column
Case 3
col3 = col.Column
End Select
Next
Debug.Print col1 & ", " & col2 & ", " & col3
End Sub

Regards,
Per

"domleg" skrev i meddelelsen
...
I am looking for a way to program the following using VBA and a command
button:

If user selected columns 4, 7 and 8 then compare this
if cells(2,4) = cells(2,7) = cells(2,8) then cell(2,12) = "ok"
else cell(2,12) = "check"

Basically, how can I get the column number of what columns are selected to
compare all data for each column selected.


 
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
Compare multiple columns-----siva and surya siva Excel Worksheet Functions 0 June 22nd 09 07:05 AM
Multiple cells or columns are selected instead of selected cell or Mikey Excel Discussion (Misc queries) 1 April 29th 09 09:48 PM
Compare multiple columns in two workbooks? Ed Excel Programming 4 March 22nd 07 06:07 PM
compare multiple columns jrm Excel Discussion (Misc queries) 3 August 20th 06 03:51 PM
Compare two sheets and perform action routine wayliff[_9_] Excel Programming 2 January 16th 06 08:28 PM


All times are GMT +1. The time now is 02:21 AM.

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"