+ Reply to Thread
Results 1 to 5 of 5

Select Case Macro (Function)

  1. #1
    Registered User
    Join Date
    01-06-2011
    Location
    santa ana
    MS-Off Ver
    Excel 2007
    Posts
    9

    Select Case Macro (Function)

    Hello,

    I need the following as a macro function.

    If ColumnA= "Domain1",
    then ColumnC = "english/" & ColumnB (whichever cell is next to the active cell)


    I would like to use a Select Case Macro for this:
    Case Domain1
    english/Page

    Case Domain2
    french/Page2

    Table
    Column A Column B Column C
    Domain1 Page
    Domain 1 Page1
    Domain 2 Page2


    Final Table (Goal)
    Column A Column B Column C
    Domain1 Page english/Page
    Domain 1 Page1 english/Page1
    Domain 2 Page2 french/Page2

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Select Case Macro (Function)

    Hi, nguyenak,

    I´d go with a formula instead of VBA. Code goes behind the worksheet where it´s to be used (right-click on the worksheet tab, View Code):
    Please Login or Register  to view this content.
    This will only help with new entries.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    01-06-2011
    Location
    santa ana
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Select Case Macro (Function)

    Hi HaHoBe,

    Im new to VBA so Im sorry for not following your instructions. I've attached the file with your code included. What do I do next?

    thanks again for your help
    Attached Files Attached Files

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Select Case Macro (Function)

    Hi, nguyenak,

    like stated above teh event will only fiore for new entries (or if you alter the entries). If you want the existing rows to be amended you would need something like the following whoich would go into a normal module:
    Please Login or Register  to view this content.
    To run the code use ALT+F8 to choose from the list of available macros.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    01-06-2011
    Location
    santa ana
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Select Case Macro (Function)

    works perfect...thank you so much.

    thanks again!

+ 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