+ Reply to Thread
Results 1 to 4 of 4

Replace values in a selected column with different values

  1. #1
    Registered User
    Join Date
    08-12-2010
    Location
    Austin, Tx
    MS-Off Ver
    Excel 2003
    Posts
    7

    Replace values in a selected column with different values

    All,

    I have a spreadsheet that has a column with 4 different values in it. I need to replace those values with different values. (It's replacing kilo values to the lbs values)
    The values that are to be replaced are as follows:
    50 should be 110
    60 should be 132.28
    69 should be 152.12
    70 should be 154.32

    I already have the macro I'm trying to create selecting the range (which will vary in size each month) using the following code, I'm just stuck on the REPLACE part of it (having a Brain Fart):

    Sub WeightConversion()
    Dim rngSalesUnit As Range
    Set rngSalesUnit = Range("A1:Z1").Find("sales_unit")
    If rngSalesUnit Is Nothing Then
    MsgBox "Sales_Unit column was not found."
    Exit Sub
    End If
    Range(rngSalesUnit, rngSalesUnit.End(xlDown)).Select
    Replace
    End Sub

    Any suggestions would be great!!

    Thank you in advance

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Replace values in a selected column with different values

    How about:

    Please Login or Register  to view this content.
    After you have Selected the range to change.
    Gary's Student

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Replace values in a selected column with different values

    Hi Mencae and welcome to the forum.

    You don't need VBA code to do this process. All you need to do is use the Paste Special using a Multiply by 2.2.

    Do this. Type 2.2 somewhere in a cell and copy it to the windows clipboard.

    Highlight the cells you want to change and then click on Paste Special. In the Paste Special dialog click on Multiply and all those selected values will update to Kilo.

    Or Read http://www.mrexcel.com/articles/past...-operation.php
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    08-12-2010
    Location
    Austin, Tx
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Replace values in a selected column with different values

    This is exactly what I thought of late last night while in bed. I just wish I had read your solution sooner to save me some sleep (LOL)

    Works perfect!!

    Thank you Jakobshavn!!!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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