Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try:
Sub Test() Dim r As Range, c As Range Dim rw As Long, col As Long Dim ws As Worksheet Set ws = ActiveSheet rw = ActiveCell.Row col = ActiveCell.Column Set r = ws.Range(ws.Cells(rw + 1, col - 2), _ ws.Cells(Rows.Count, 1).End(xlUp)) For Each c In r.Cells If Not IsEmpty(c) Then c(0, 3).FormulaR1C1 = _ "=EXACT(RC[-1],R[1]C[-1])" Next End Sub I didn't follow what you meant by sorting distorting the data in adjacent columns. If you don't expand the selection to include these columns then it should only sort selected or specified columns. Or am I missing something ? Regards, Greg "KH_GS" wrote: Hi All, I need to match words within a column, for the first 3 columns. I have the following code done, however, this will not work if there is a blank row in between the list of words that I have in the column. x = ActiveCell.Row y = ActiveCell.Column Do While Cells(x + 1, y - 2).Value < "" 'to input EXACT formula ActiveSheet.Cells(x, y).FormulaR1C1 = "=EXACT(RC[-1],R[1]C[-1])" x = x + 1 Loop I cannot sort columns 2 and 3 alphabetically because it will distort the data in adjacent columns. How can I go about matching the words down the column skipping blank rows and check with the next non-blank cell? -- KH_GS ------------------------------------------------------------------------ KH_GS's Profile: http://www.excelforum.com/member.php...o&userid=32920 View this thread: http://www.excelforum.com/showthread...hreadid=527404 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop Until non-incrementing cell condition met. | Excel Worksheet Functions | |||
Using For loop to condition | Excel Programming | |||
Loop to Next item in For Next on Condition | Excel Programming | |||
Loop until a condition is False | Excel Programming | |||
two-condition loop | Excel Programming |