+ Reply to Thread
Results 1 to 8 of 8

Macro to display region for countries

  1. #1
    Registered User
    Join Date
    12-06-2016
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    12

    Macro to display region for countries

    Hi,

    I need a macro to display region for countries. For example in sheet 1 I'm having country list and in sheet 2 I have countries list and to which region it belongs. Once I run the macro it should display the result in sheet 1.

    Ex : Sheet 1

    Country Region
    India
    Bermuda
    Hong Kong
    Jersey

    Sheet 2 :
    Country Region
    India Asia Pacific
    Bermuda North America
    Hong Kong Asia Pacific
    Jersey Europe
    Dubai Mena
    Vietnam Asia Pacific
    Canada North America

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Macro to display region for countries

    Is Country Region all in one cell?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    12-06-2016
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    12

    Re: Macro to display region for countries

    Hi Mike,

    no both are in different cells

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Macro to display region for countries

    Do you really need vba?

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-06-2016
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    12

    Re: Macro to display region for countries

    yes I need in macro , I tried the below one but stuck with the region range, it displays result only for B2 could you please help ?

    Sub Ctry_Reg()
    Dim Country As Long
    Dim Region As Long
    Country = Sheet1.Range("A2:A5").Row
    Region = Sheet1.Range("B:B").Column
    Sheet1.Cells(Country, Region) = Application.WorksheetFunction.VLookup(Sheet1.Range("A2:A5"), Sheet2.Range("A2:B13"), 2, False)
    Country = Country + 1
    'MsgBox "Done"
    End Sub

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Macro to display region for countries

    Give this a try

    Please Login or Register  to view this content.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Macro to display region for countries

    Another way you can maybe adjust for you needs

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-06-2016
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    12

    Re: Macro to display region for countries

    Thanks this is much easier :D

+ 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. Replies: 0
    Last Post: 08-02-2016, 12:17 AM
  2. Replies: 2
    Last Post: 06-01-2015, 06:23 PM
  3. [SOLVED] Formula to put differnt contries for their specific regions, ATTCD countries with region
    By raysrains in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-28-2014, 09:42 AM
  4. Finding top 5 countries with a macro button
    By joegor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2014, 04:41 AM
  5. Replies: 4
    Last Post: 05-17-2012, 06:30 PM
  6. Replies: 1
    Last Post: 10-04-2007, 12:04 PM
  7. How to display map that user selects region
    By Jack Gur in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2005, 11:05 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