I am not experienced in VBA coding.
My VBA code:
Search = InStr(ActiveCell.NumberFormat, Chr(128))
Selection.Find(What:=Search, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
It searches and activates the cells which include the € symbol. It works only if I manually define my selection range.
When I try inserting ActiveSheet.Range("H:H").Select
to make column H my selection (which is my goal), the code stops working.
This code found the cell with the Greek Euro format in the range
A1:A6
onSheet1
in the workbook containing the code (ThisWorkbook
).The cell must hold a value (to find blanks change
"*"
to""
).No idea why
[$€-408]
denotes Greek.The problem is in the
ActiveCell
, which is changing depending on what you are selecting. Try like this, you should get lucky:Once you feel a bit better with recording macros, you may try to avoid
ActiveSheet
,Selection
andActiveCell
:How to avoid using Select in Excel VBA