+ Reply to Thread
Results 1 to 4 of 4

Excel VBA - Flip text around EQUALS sign

  1. #1
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Excel VBA - Flip text around EQUALS sign

    Hi all,

    Have a unique little problem here that I know can be solved quite easily with some good code.

    Often in my coding I am working with setting properties equal to a value and then must flip those in reverse (read versus write). For instance...

    textbox1 = name1
    textbox2 = name2
    textbox3 = name3
    texthello = hello
    textExcel = Excel


    Where I need to quickly generate some code that outputs:

    name1 = textbox1
    name2 = textbox2
    ...
    ...
    ..


    So, I don't really know where to begin as far as what interface to use. Textbox on a sheet or form and somehow loop through each line - this seems harder than it sounds.
    I need to paste multi-line text of code. I don't care how sloppy it is. Or even if the debug.print prints my results. I just need finished results. This will speed up my workflow. And yes, there are ways around this, such as naming variables in a numerical order and doing a for-loop etc, but my naming convention will be random sometimes and I need this solution.


    Any ideas from the experts?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Re: Excel VBA - Flip text around EQUALS sign

    Hi!

    I actually remedied my issue by pasting my code into the sheet and using Excel's Text-to-Columns feature and setting the delimiter to "=" to split the text. Then a simple concatenate formula to re-bind the seperated columns.


    Very powerful tool that rarely lets me down.
    This will save a lot of time.

    However, there is some minor nuances with it. A code solution would be much cleaner I feel. I will solve the thread after some time. Perhaps someone has another interesting way of solving this problem!

    Thanks

  3. #3
    Valued Forum Contributor unit285's Avatar
    Join Date
    10-29-2015
    Location
    TN
    MS-Off Ver
    Office 365
    Posts
    358

    Re: Excel VBA - Flip text around EQUALS sign

    Quote Originally Posted by ironfelix717 View Post
    Hi!

    I actually remedied my issue by pasting my code into the sheet and using Excel's Text-to-Columns feature and setting the delimiter to "=" to split the text. Then a simple concatenate formula to re-bind the seperated columns.
    I'm having trouble understanding the problem. Could you attach a copy of your workbook? Is 'Textbox1' a cell value? or a Textbox Value? And same with 'Name1'? etc...?
    Last edited by unit285; 01-05-2019 at 11:14 PM.

  4. #4
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Re: Excel VBA - Flip text around EQUALS sign

    Unit285,

    Thanks for replying... The problem is quite simple. I need to switch the assignment of multiple lines of code quickly.

    Please Login or Register  to view this content.

    Copy/Paste/Cut gets old. I remedied the solution with Excel's Text-to-Columns feature, which is OK.

    However, I just found MZ-Tools, a great third party plug-in (hopefully i am allowed to mention this) that will do it VERY quickly!

    Thanks - closing thread as solved

+ 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. Flip of text in an excel cell
    By Nasir Sajid in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-13-2012, 06:10 AM
  2. How to add Equals sign to entire column
    By barbachjordan in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-18-2010, 08:00 PM
  3. Won't recognize equals sign
    By roasthawg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2009, 01:14 PM
  4. Can I copy color with an equals sign?
    By rohed in forum Excel General
    Replies: 8
    Last Post: 03-10-2007, 04:03 PM
  5. Replies: 4
    Last Post: 05-26-2006, 08:30 AM
  6. [SOLVED] [SOLVED] flip negative sign
    By wilson@irco in forum Excel General
    Replies: 6
    Last Post: 03-13-2006, 08:35 AM
  7. Linking with equals sign doesn't always work
    By marty53 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 09-06-2005, 09:05 AM
  8. [SOLVED] Linking with equals sign doesn't always work
    By marty53 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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