+ Reply to Thread
Results 1 to 2 of 2

Help changing macro to function, selecting based on cell being text

  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    14

    Help changing macro to function, selecting based on cell being text

    So I'm pretty new to using excel VBA, I've mainly worked with Access and it's different.I recorded a macro and then altered it so that I could use it over an over again relative to a selected cell. The issue is that I don't have to have to run this macro over 1000 times and was looking for a way to create a loop it somehow.
    My issue is I don't know how to specify where to start/end the loop.

    The data that I have looks like this:
    example1.PNG

    The macro that I made is the following:
    Please Login or Register  to view this content.
    Main issue is that the number of codes (in this case 1 through 5) varies from 18 to 20 , so its not always the same. Manually I just went for the largest number and then worked over it, but in a function that wouldn't work?

    I was thinking along the lines of: If the cell in column A is text then set as active cell, do macro, then find next text cell.

    Ideas? Thanks!

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Help changing macro to function, selecting based on cell being text

    You could just create a simple refenece table with JUST the names (Name 1-3) and columns B:D, then you can divide by a vlookup on THAT reference table... ONE formula for the entire dataset and no need for the looping macro...
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

+ 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. Changing Text Box background based on other cell text
    By Zonc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2014, 04:45 AM
  2. Replies: 1
    Last Post: 02-19-2014, 10:04 PM
  3. selecting macro based on cell value
    By simonsmith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2008, 04:35 PM
  4. [SOLVED] Changing the text within a function based on a cell reference.
    By jedale@gmail.com in forum Excel General
    Replies: 2
    Last Post: 07-14-2006, 12:25 PM

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