Hi, can you help please? I have recorded a macro and it did exactly what I required when it was recorded, yet when I run it again the results are not the same.
I want to identify occurances of '77' in column M and when found set the contents of column K to 'emeropid'.
What I recorded was :-
select 1st row and turned on auto-filter.
selected '77' from autofilter dropdown.
selected the column K cell of the first result and changed it to 'emeropid'
copied that cell to the other rows identified by the auto filter.
When I stopped recording and turned off the autofilter the results were exactly as planned - any row with 77 in column M had 'emeropid' on column K.
To test it I replaced the entire Column K with the original unchanged data and ran the Macro. It did not make any changes at all. I don't understand why not, or how I can achieve what I'm trying to.
The macro I recorded looks like this.
'
Rows("1:1").Select
Range("C1").Activate
Selection.AutoFilter
ActiveWindow.LargeScroll ToRight:=1
Selection.AutoFilter Field:=13, Criteria1:="77"
Range("K5").Select
ActiveCell.FormulaR1C1 = "metpol.emeropid"
Range("K5").Select
Selection.FillDown
ActiveWorkbook.Save
End Sub
Any help would be appreciated.
Pete
Bookmarks