Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2019, 12:31 AM
Chibiberu Chibiberu is offline Please help! Macros not recorded as expected Windows 7 64bit Please help! Macros not recorded as expected Office 2013
Novice
Please help! Macros not recorded as expected
 
Join Date: May 2014
Location: Japan
Posts: 11
Chibiberu is on a distinguished road
Default Please help! Macros not recorded as expected

Hi!



I am totally novice in macros and VBA.

I want to create a macro that will operate about 30 find/replace steps.
The first find/replace I need to do consist in replacing a non printable (#0D) character which first occurrence is always located at the same position in the file.
All other find/replace steps
So I decided to create a macro using the "Record macro..." command.
But almost no step I operate is recorded.
For instance, after a succession of about 30 "find/replace" steps, I only get this in the macro:
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.Copy
End Sub
Some times I only get the last Find/Replace step
I tried several times, but only oner step is recorded in the macro (and not always the same step!!!)


So, I have a few questions:


1. Is it normal that actions I did after I started recording the macro are not recorded?
(for instance: the action of selecting a certain character at a certain location in the file, or all Replace actions I did...)


2. Is it possible to add a VBA step that will automatically select a character that is always located at the same place in the file?


3. How can I perform a Find/Replace step that finds all occurrences of #0D character and replaces them by something else? (i.e. paragraph break + "&&&" sequence)

Many thanks in advance

Last edited by Chibiberu; 03-30-2019 at 12:19 AM.
Reply With Quote
  #2  
Old 03-29-2019, 12:52 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Please help! Macros not recorded as expected Windows 7 64bit Please help! Macros not recorded as expected Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,769
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Hi and welcome
using a descriptive title will almost certainly attract more help.
Please change it ( click Go advanced to edit)
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 03-29-2019, 04:18 PM
macropod's Avatar
macropod macropod is offline Please help! Macros not recorded as expected Windows 7 64bit Please help! Macros not recorded as expected Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

There is a lot the macro recorder won't record, but Find/Replace actions isn't one of them.

To see how you can combine multiple Find/Replace actions in a single macro, check out https://www.msofficeforums.com/word/...s-e-mails.html

As for the '#0D character', I assume you mean the ASCII 13 character, which Word displays as ¶. That can be found via Find = ^13.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 03-30-2019, 12:34 AM
Chibiberu Chibiberu is offline Please help! Macros not recorded as expected Mac OS X Please help! Macros not recorded as expected Office 2016 for Mac
Novice
Please help! Macros not recorded as expected
 
Join Date: May 2014
Location: Japan
Posts: 11
Chibiberu is on a distinguished road
Default

macropod,

Thank you for the information.
I didn't know I could find a character by its ASCII code (^13)
Knowing that, I just need a series of Replace steps in the macro. I could have one recorded in the macro. So, I duplicated this step in the macro and changed each Replace command with the right characters to find and replace.
It worked!

By the way, ASCII 13 character is not interpreted as paragraph break on MacOS. I just get a small square displayed
Paragraph marks are found when I search for ^10 characters. I guess this is because I am working on MacOS, not Windows
(I know, my public profile still shows "Windows7" although I changed it with "MacOS")

Anyway, you "saved my life". Many thanks!
Reply With Quote
  #5  
Old 03-30-2019, 02:42 AM
macropod's Avatar
macropod macropod is offline Please help! Macros not recorded as expected Windows 7 64bit Please help! Macros not recorded as expected Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In Word, paragraph breaks consist of an 0D 0A pair (ASCII 13 & 10). ASCII 13 on its own, though it might appear like a paragraph break, isn't one - though it sufficies when using a wildcard Find. If you want to do a Find for paragraph breaks when not using wildcards, use Find = ^p.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify recorded macro to run until end of document peter961 Word VBA 1 09-04-2017 02:50 PM
Embedded Video Not Playing in Recorded Presentation bhadden1 PowerPoint 0 08-16-2017 03:07 PM
Add previously recorded sound and synchronize with slide annimations daniellouw PowerPoint 1 03-03-2017 11:14 AM
Can I record more to add on to a recorded Macro? Clueless in Seattle Word VBA 3 05-25-2015 01:21 AM
Recorded audio (record slide show) won't play in older versions Landy PowerPoint 0 03-03-2012 03:14 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft