+ Reply to Thread
Results 1 to 4 of 4

Change selected cells to the same number

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Change selected cells to the same number

    I'm trying to change the content of all pre-selected cells in my worksheet to the same number. The macro would only work on already-selected cells.

    A message box would ask the amount to change all the selected cells to and would make the change once the user had made the entry and clicked OK. A change of font colour would be helpful to highlight the changed cells.

    Can someone advise on some code to do this?

    Grateful for any advice.

    Last edited by CDandVinyl; 01-07-2024 at 11:39 PM.
    Using Excel , Word and Access 2003 - For the whole of 2024

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Change selected cells to the same number

    May be this?

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Last edited by :) Sixthsense :); 01-08-2024 at 12:45 AM. Reason: Added Instructions


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: Change selected cells to the same number

    A change of font colour would be helpful to highlight the changed cells
    Adding to above
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Change selected cells to the same number

    Thanks guys. All working!

+ 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. Change selected cell value if number, mark selected cell if text string
    By Jannickk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-31-2020, 04:15 AM
  2. Macro to Change Dates in selected cells from Number to Short Date Format
    By sebi171 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2020, 11:32 AM
  3. How do you change selected cells?
    By cooldraft in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2020, 01:52 PM
  4. Replies: 1
    Last Post: 06-12-2019, 11:59 PM
  5. [SOLVED] Print Selected range number of times with little change
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2015, 11:29 AM
  6. [SOLVED] Change cells format when a value is selected
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:15 AM
  7. Replies: 1
    Last Post: 12-06-2010, 12:05 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