+ Reply to Thread
Results 1 to 4 of 4

Macro to change cell format doesn't run

  1. #1
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Macro to change cell format doesn't run

    So I tried to build a macro using Record that changes selected cells format to: _-* #,##0.00_-;(#,##0.00);_-* " - "??_-;_-@_-
    This is essentially the standard 'accounting' format without symbol that excel has, but with parenthesis instead of a minus symbol for negative numbers.

    However the macro returns a Run-time error 13 saying Type mismatch. And it's paused at the very first line of code. My code is below - any ideas?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Macro to change cell format doesn't run


    Hi !

    As ActiveCells does not exist in VBA (only one cell can be active !), just check in VBA inner help …

  3. #3
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Re: Macro to change cell format doesn't run

    Hi Marc,

    I changed it to "ActiveCell.NumberFormat" and it still kicks off.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macro to change cell format doesn't run

    Hello heytherejem,

    Please try;

    Please Login or Register  to view this content.
    Enjoy.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel doesn't change the cell format on save through the workbook save button
    By mitko1994 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-16-2017, 03:09 PM
  2. [SOLVED] Looking for cell color format change in macro?
    By scotth73 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2017, 02:37 PM
  3. Macro To Change Cell Format
    By S-Hart in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2015, 03:21 PM
  4. Filter function doesn't change with column format change
    By sabrefan1970 in forum Excel General
    Replies: 0
    Last Post: 02-21-2014, 11:55 AM
  5. Replies: 2
    Last Post: 06-11-2012, 07:30 PM
  6. Replies: 1
    Last Post: 08-18-2009, 08:55 AM
  7. Change Event doesn't change until I return to the Target Cell
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-11-2007, 05:20 PM

Tags for this Thread

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