+ Reply to Thread
Results 1 to 7 of 7

VBA to modify numbers in input column

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

    VBA to modify numbers in input column

    I'm trying use VBA to change all numbers below one number to a different number.

    An input box would request the column to work on. Having entered this , another input box would request a number below which cells should be changed. A third input box would ask for the number to change them to.

    As an example, the user might enter column B as the one to work on , and in the second input box they might enter 5. In the last input box the user might enter 10.

    This would mean that all cells in column B containing numbers less than 5 should all be changed to 10.

    So , in Column B

    2
    3
    7
    1
    8

    Would change to

    10
    10
    7
    10
    8


    Can someone advise on some VBA to satisfy this?

    Grateful for any help.


    Using Excel , Word and Access 2003 - For the whole of 2024

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA to modify numbers in input column

    Hi CDandVinyl,

    Try below code ... Sample file attached as well
    Please Login or Register  to view this content.
    Attached Files Attached Files
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

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

    Re: VBA to modify numbers in input column

    Very good - many thanks. It's working fine and does the job perfectly. As I'm working with a long list of numbers , would it be an easy thing to have the changed numbers made to be a different colour , say red? It's just so i can pick them out once the macro is run.


  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA to modify numbers in input column

    This will change the cell color to red

    Please Login or Register  to view this content.

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

    Re: VBA to modify numbers in input column

    Another Option...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    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!!!

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

    Re: VBA to modify numbers in input column

    Many thanks guys for your help. This is working perfectly now. Problem solved!


  7. #7
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA to modify numbers in input column

    Glad to help & thanks for the added Rep.

+ 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. Input Info from Column/Cells some blank some numbers
    By viclea in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-10-2020, 11:09 AM
  2. [SOLVED] Column deletion using column numbers as user input (how to change syntax of ranges)
    By Ianmacros in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-23-2019, 05:22 PM
  3. [SOLVED] Modify VBA to include input box for Range
    By 3345james in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2015, 02:48 PM
  4. How to Loop through Column and Modify Values Based on User Input
    By bryanmarks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2015, 11:38 AM
  5. [SOLVED] Modify Formula with input box
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2014, 11:46 AM
  6. Modify Code to Log Cell Input and Value
    By HP RodNuclear in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-12-2011, 10:13 AM
  7. Modify code to input .txt files
    By daz18983 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-18-2010, 04:02 PM

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