+ Reply to Thread
Results 1 to 5 of 5

Simple If/Then Macro

Hybrid View

rhybeka Simple If/Then Macro 06-11-2013, 07:03 AM
:) Sixthsense :) Re: Simple If/Then Macro 06-11-2013, 07:13 AM
rhybeka Re: Simple If/Then Macro 06-11-2013, 07:28 AM
:) Sixthsense :) Re: Simple If/Then Macro 06-11-2013, 07:35 AM
rhybeka Re: Simple If/Then Macro 06-11-2013, 07:50 AM
  1. #1
    Registered User
    Join Date
    01-16-2012
    Location
    Columbus, OH
    MS-Off Ver
    Excel for Mac, Office 365 Online
    Posts
    22

    Simple If/Then Macro

    Hi All!

    I need to create a simple if/then VBA in Excel. I'd just use it as a formula but I have too many variables even for a nested. I need Excel to check a column of locations and if (for example) a location = Columbus, Oh, then put a value in the column to the right of it of United states. I have about 30 locations to do, hence the reason I can't seem to get just a formula to work it appears. Plus, I have to repeat this on a monthly basis. If someone would point me in the right direction I would greatly appreciate it!

    Becky

    Sorry all - realized I posted in the wrong forum for VBA. If this can be done via a formula I'd be ok with that as well. IF/And just hasn't worked out very well either.
    Last edited by rhybeka; 06-11-2013 at 07:12 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Simple If/Then Macro

    Please attach a sample workbook with expected output for better understanding


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    01-16-2012
    Location
    Columbus, OH
    MS-Off Ver
    Excel for Mac, Office 365 Online
    Posts
    22

    Re: Simple If/Then Macro

    sample.xlsx

    Sure thing! So my location column would be the first column, then in the column next to it, I'd need it to look at the location and assign a region.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Simple If/Then Macro

    Thanks for the file please explain to which data we have to compare the City and get the region from where?

  5. #5
    Registered User
    Join Date
    01-16-2012
    Location
    Columbus, OH
    MS-Off Ver
    Excel for Mac, Office 365 Online
    Posts
    22

    Re: Simple If/Then Macro

    I just had an epiphany - a vlookup! duh! I have the regions and cities on a separate worksheet from the one I am attempting to add the Region column to. I should just be able to write a formula leveraging that information, right?

    Nevermind! The Vlookup worked for what I needed. Thanks for trying to help!
    Last edited by rhybeka; 06-11-2013 at 08:03 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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