Results 1 to 3 of 3

Macro: Trying to record Find "word" select all, insert shift to right. Doesn't play back

Threaded View

johndoe79 Macro: Trying to record Find... 06-04-2021, 08:38 PM
FDibbins Re: Problem with Macro 06-04-2021, 11:42 PM
johndoe79 Re: Problem with Macro 06-05-2021, 11:51 AM
  1. #1
    Registered User
    Join Date
    12-16-2014
    Location
    MN
    MS-Off Ver
    2013
    Posts
    27

    Macro: Trying to record Find "word" select all, insert shift to right. Doesn't play back

    Ok, this seems to work fine when I do it live, but if I record it with a Macro and play it back I get a run-time error. I noticed what I'm doing isn't totally within the code.

    Basically I want to find all instances of a word, and shift those cells over.

    Let's say it's the word "cat"

    I go to find, type cat, hit ctrl A

    right click on one of the instances, select insert, shift cells right.

    It's fine when I do it live, but when I run the macro I get a run time error.

    However the VBA just shows this:

    Sub Macro16()
    '
    ' Macro16 Macro
    '
    
    '
        Cells.Select
        Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    End Sub
    No references to me going to find the word "cat" or anything.

    Any idea?
    Last edited by johndoe79; 06-05-2021 at 11:50 AM. Reason: title change

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro problem - loops theough user defined functions not called in macro
    By beccyclaire in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-04-2016, 02:09 AM
  2. Problem with recording a macro with long formula - works in Excel but not in macro
    By tonybeo2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2015, 11:25 AM
  3. [SOLVED] Excel Macro - Copy & Paste (Font) problem & Delete Last Added Rows problem
    By LennartB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2015, 06:58 AM
  4. Macro template good saved but running macro with imported data problem
    By brazilexcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2015, 10:42 PM
  5. Macro Problem with VBA need Help (copy past cells with macro and message box)
    By Nissort in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2013, 12:17 PM
  6. Problem using formulas within macro + problem with defined name.
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2011, 04:39 AM
  7. Problem in updating all worksheets of a workbook using a macro that calls another macro
    By saai_ram@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2006, 01:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1