Before I would try a macro I might try writing a regular expression... Also, it looks like your macro simply enters a hard-coded value.
And I've written a lot of macros Get BlueMail for Android On Mar 14, 2025, 11:46 PM, at 11:46 PM, James <[email protected]> wrote: >I have a lot of times without the colon that I want to create a macro >to >easily change them to 2 digit:2 digit. >I tried to record a macro but it hard coded the cell I recorded on. > >Here's what it made: >REM ***** BASIC ***** > >Sub Main > >End Sub > > >sub split_time >rem >---------------------------------------------------------------------- >rem define variables >dim document as object >dim dispatcher as object >rem >---------------------------------------------------------------------- >rem get access to the document >document = ThisComponent.CurrentController.Frame >dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") > >rem >---------------------------------------------------------------------- >dim args1(0) as new com.sun.star.beans.PropertyValue >args1(0).Name = "ToPoint" >args1(0).Value = "$D$2387" > >dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1()) > >rem >---------------------------------------------------------------------- >dim args2(0) as new com.sun.star.beans.PropertyValue >args2(0).Name = "StringName" >args2(0).Value = "14:35" > >dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, >args2()) > > >end sub > >-- >To unsubscribe e-mail to: [email protected] >Problems? >https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ >Posting guidelines + more: >https://wiki.documentfoundation.org/Netiquette >List archive: https://listarchives.libreoffice.org/global/users/ >Privacy Policy: https://www.documentfoundation.org/privacy -- To unsubscribe e-mail to: [email protected] Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ Privacy Policy: https://www.documentfoundation.org/privacy
