LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to find the unique cell value?

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
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
Maddening Dilemma - Compare each cell within column a to each cell in column b and find unique matches [email protected] Excel Worksheet Functions 66 May 1st 23 03:44 AM
find unique records frankfurtjoe Excel Discussion (Misc queries) 4 May 19th 09 04:29 PM
Find Unique Changes Francis Excel Worksheet Functions 2 April 25th 08 04:19 PM
Find Unique Sean Timmons Excel Discussion (Misc queries) 6 December 26th 06 11:27 PM
Find Unique Entries Frank Wilson Excel Programming 2 September 2nd 04 12:53 PM


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