View Single Post
 
Old 03-28-2016, 06:37 PM
Rod_Bowyer Rod_Bowyer is offline Windows 10 Office 2007
Novice
 
Join Date: Mar 2016
Posts: 12
Rod_Bowyer is on a distinguished road
Default Macro to Find and Replace Does Not Work - But Works Manually

I have a spreadsheet into which I import web data. One of the columns is called "Grade". However, some of the data is imported as a short date. When I use the "Find and Replace" facility it finds all the "dates" and replaces them with the appropriate "Grade". However, when I record a Macro while doing this it works while I am recording the Macro but does not work when I run the Macro later.
The recorded Macro is:-
Sub Macro2()
'
' Macro2 Macro
' This section of the macro replaces "dates" in the Grade column and replaces them with Grades.
'
' Keyboard Shortcut: Ctrl+a
'
Application.Goto Reference:="R19C9"
Range(Selection, Selection.End(xlDown)).Select
Selection.Replace What:="04-05-2016", Replacement:="'4/5", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
I have copied just this column into a spreadsheet to show what it looks like.
I have only used one "date" so far in this Macro.
Normally this data is in Column I starting at row 19. Why this should work while I am recording it but not while I am running it is a frustrating mystery.
I would very much appreciate any help ... yet again!
Attached Files
File Type: xlsx Example_For_Forum.xlsx (9.5 KB, 11 views)
Reply With Quote