Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default matching random text

I've done a couple simple macros, but new at this and can't figure this one
out. It would search column a for a stock symbol listed there 3 or more
times and copy and paste that stock to column b. An example of what I would
like the macro to do is below. If this is possible, any help would be
appreciated, especially the code that would select the stock if it appears
in column a 3 or more times. Thanks in advance. Lance



Column A Column B
ALKS DECK
ASVI
BEBE
BLX
BLX
BONT
CAE
CETV
CNTE
CRFT
CRMT
CRMT
DECK
DECK
DECK


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default matching random text

Lance,
Try this macro
Row1 must have a heading for advanced filter to work
Cecil

Sub Macro1()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

LRA = Range("A" & Rows.Count).End(xlUp).Row
Range("A1:A" & LRA).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=Range("B1"), Unique:=True

LRB = Range("B" & Rows.Count).End(xlUp).Row

For i = LRB To 2 Step -1
If Evaluate("COUNTIF(" & Range("A2:A" & LRA).Address _
& "," & Range("B" & i).Address & ")") < 3 Then
Range("B" & i).Delete Shift:=xlUp
End If
Next i

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub
"Lance\Sheri" wrote in message
news:5eqgb.509853$Oz4.364373@rwcrnsc54...
I've done a couple simple macros, but new at this and can't figure this

one
out. It would search column a for a stock symbol listed there 3 or more
times and copy and paste that stock to column b. An example of what I

would
like the macro to do is below. If this is possible, any help would be
appreciated, especially the code that would select the stock if it appears
in column a 3 or more times. Thanks in advance. Lance



Column A Column B
ALKS DECK
ASVI
BEBE
BLX
BLX
BONT
CAE
CETV
CNTE
CRFT
CRMT
CRMT
DECK
DECK
DECK




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
Return Text based upon text matching klmiura Excel Worksheet Functions 6 January 30th 10 12:21 AM
Display text at random Markv Excel Discussion (Misc queries) 2 July 25th 08 09:08 AM
Help with Matching Text Fields - Then Moving the Matching Cells Side by Side [email protected] Excel Discussion (Misc queries) 2 June 11th 07 02:38 PM
Random Matching Sabotage1945 Excel Worksheet Functions 7 May 3rd 06 04:15 PM
random number with text T Harris Excel Worksheet Functions 10 December 30th 05 04:34 PM


All times are GMT +1. The time now is 03:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"