Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I build the following code to search from a searchrow (PG_Begin) in
sheet assumptions with a loop. I notice that cells.find doesn't find a unique cell and I want to know what code I must use to let the macro find the unique cellvalue requested?? For example, if the searchvalue is net_val-1 the copied column is net_val-1_YTD which is ofcourse not the column I wanted to be copied. Sub CommandButton3_Click() On Error GoTo ErrorHandler Application.ScreenUpdating = False Application.Goto Reference:="PG_Begin" Row = ActiveCell.Row While ActiveSheet.Cells(Row, 1).Value < "" PG = ActiveSheet.Cells(Row, 1).Value Sheets("olap").Select Cells.Find(What:=PG, After:=ActiveCell, LookIn:=xlFormulas _ , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False).Activate ActiveCell.EntireColumn.Select ActiveCell.EntireColumn.Copy ActiveSheet.Paste (Sheets("extract").Range("ia1").End(xlToLeft).Offs et(, 1)) Sheets("Assumption").Select Row = Row + 1 Wend Sheets("extract").Select Columns("A:A").Select Selection.Delete Shift:=xlToLeft MsgBox ("correcting OLAP extract completed") ErrorHandler: Application.ScreenUpdating = True MsgBox (Err.Description) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Maddening Dilemma - Compare each cell within column a to each cell in column b and find unique matches | Excel Worksheet Functions | |||
find unique records | Excel Discussion (Misc queries) | |||
Find Unique Changes | Excel Worksheet Functions | |||
Find Unique | Excel Discussion (Misc queries) | |||
Find Unique Entries | Excel Programming |