Bill Golden
asked on
Problem with simple macro
I am having a problem with a very simple macro. This may have something to do with other problems we are having with Office 365 programs. I stripped a one page document down to one line for testing.
The line reads as follows:
___ Home Office Deduction 75.XX Net Operating Losses 300.00
Placing the cursor at the beginning of the line I recorded a macro to find .XX and then put a space between the two XXs. Then jump to the end of the line.
Simple right?
No. The macro runs but puts the space at the beginning of the line.
I have recorded it multiple times, all with the same outcome.
I have attached the file for testing.
The line reads as follows:
___ Home Office Deduction 75.XX Net Operating Losses 300.00
Placing the cursor at the beginning of the line I recorded a macro to find .XX and then put a space between the two XXs. Then jump to the end of the line.
Simple right?
No. The macro runs but puts the space at the beginning of the line.
I have recorded it multiple times, all with the same outcome.
I have attached the file for testing.
ASKER
I guess I failed to define the goal. The macro we bill more extensive in the end. I am just trying to decide what I am doing wrong in that I cannot see to get a basic macro to work. Any thoughts?
Well, being as you haven't shown us your code, no, no thoughts.
ASKER
Well, when I recorded the macro, Word produced the following code:
Sub Macro1()
'
' Macro1 Macro
'
'
CommandBars("Navigation"). Visible = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=" "
Selection.EndKey Unit:=wdLine
End Sub
Which of course is pure crap since it did not work. What I am trying to figure out is WHY?
Sub Macro1()
'
' Macro1 Macro
'
'
CommandBars("Navigation").
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=" "
Selection.EndKey Unit:=wdLine
End Sub
Which of course is pure crap since it did not work. What I am trying to figure out is WHY?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have discovered why the Macro was not recording the step. In performing the step, the find result is accomplished but you cannot X out of the step. If you do, the Macro does not include that function.
Thanks guys.
Thanks guys.
ASKER
I have discovered why the Macro was not recording the step. In performing the step, the find result is accomplished but you cannot X out of the step. If you do, the Macro does not include that function.
Open in new window