+ Reply to Thread
Results 1 to 4 of 4

Replace Column B Values based on Column A

  1. #1
    Registered User
    Join Date
    01-23-2015
    Location
    Dublin
    MS-Off Ver
    2010
    Posts
    10

    Replace Column B Values based on Column A

    Hi,

    I am trying to build a macro that will:

    See if A1 (integer) is empty

    If A1 empty, clear contents of B1

    If A1 has an integer, do nothing


    I need this to loop down to row 57,000

    See my attempt at the code below...could anyone help me out or point me in the right direction?

    Thanks
    Karl


    Sub Clear_B()

    Dim Column_A As Integer, Column_B As String

    Application.ScreenUpdating = False

    For Column_A = 1 To 57000

    If Cells(i, 1).Value Is Not interger Then Range(Cells(Column_A, 1), Cells(Column_A, 2)).Replace Cells(Column_A, 2).Value, ""

    End If

    Next i

    End Sub

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace Column B Values based on Column A

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-23-2015
    Location
    Dublin
    MS-Off Ver
    2010
    Posts
    10

    Re: Replace Column B Values based on Column A

    HI,

    Yes, that worked perfectly. Thanks a million.

    I think I need to explore more functions of VBA to think about the best way to solve these problems.

    Thanks
    Karl

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace Column B Values based on Column A

    You're welcome. Glad to help out and thanks for the feedback.

+ 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. [SOLVED] Replace data in one column automatically based on another column
    By jzacharias in forum Excel General
    Replies: 1
    Last Post: 06-22-2015, 01:30 PM
  2. [SOLVED] Replace values in rows based on criteria in column B
    By Marq555 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2015, 10:25 AM
  3. Sum up a column based off adjacent column and replace values with the sum.
    By kleptilian in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-13-2015, 11:55 AM
  4. Replace column values based on a list
    By bigroo1958 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2014, 07:12 AM
  5. Replies: 3
    Last Post: 03-22-2014, 08:35 AM
  6. [SOLVED] Find Value in 1 column based on another column then replace with value of yet another.
    By johanbosman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-07-2013, 11:50 AM
  7. Replies: 0
    Last Post: 10-13-2005, 02:05 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