+ Reply to Thread
Results 1 to 4 of 4

Help With VBA Macro to select cells with certain value and perform action on adjacent cell

  1. #1
    Registered User
    Join Date
    03-07-2014
    Location
    Jackson, MS
    MS-Off Ver
    Excel 2010
    Posts
    8

    Help With VBA Macro to select cells with certain value and perform action on adjacent cell

    I am trying to learn VBA to help with conveting old reports to usable excel format. I am having trouble using VBA to set up a looping macro that would search Column A for cells with the text string: "ACTIVITY TOTAL". If cell has that value I would like to perform text to column action on the adjacent cell (R0C1). The macro recording for the test to column settings i need is :
    Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
    Semicolon:=False, Comma:=False, Space:=True, Other:=False, OtherChar _
    :=":", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
    1), Array(6, 1), Array(7, 1)), TrailingMinusNumbers:=True

    I have attached a sample of what I am currently working with. The actual file has roughly 6000 lines of data, so I would like the macro to go through all lines


    Thanks for any help you can provide.
    Attached Files Attached Files
    Last edited by MSDemocrat; 03-10-2014 at 03:37 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Help With VBA Macro to select cells with certain value and perform action on adjacent

    I'm not sure what your code block means. Are you just using text to columns with a space delimiter for activity rows?
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Help With VBA Macro to select cells with certain value and perform action on adjacent

    This worked for me. Note, your first column actually has "Activity " with a space after it.


    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-07-2014
    Location
    Jackson, MS
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Help With VBA Macro to select cells with certain value and perform action on adjacent

    Thanks for your help. That is what I needed

+ 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. Macro to search multiple (static) columns and perform calculation on adjacent cells
    By DubaiExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2013, 04:37 AM
  2. Select Multiple workbooks at once to perform an action
    By rshnkmr39 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-03-2013, 06:09 AM
  3. Select Multiple workbooks at once to perform an action
    By rshnkmr39 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-03-2013, 05:23 AM
  4. [SOLVED] Perform action on select sheets upon opening workbook
    By newrui in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2012, 03:03 PM
  5. Passing cell value to sub routine perform action on relative cells
    By glinch in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-10-2010, 08:56 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