1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Input multiple data in one cell for a macro

Discussion in 'Business Applications' started by yrobins, Apr 17, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. yrobins

    yrobins Thread Starter

    Joined:
    Apr 17, 2010
    Messages:
    3
    Hi Everyone: I am trying to create a macro, that allows me to enter multiple data in one cell, I just do not know VBA at all but I know Excel well. Here is an example of how the data should look "C02Ex04". I need 2 input pauses for this.
    The number "2" refers to a chapter and will be between 1-11. The "04" refers to the exercise number and will be between 1-9. My challenge in the macro, is allowing the second input, I don't know how to activate an F2 command to keep the cell active for more input.

    Thank you
     
  2. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,452
    Hello there, welcome to the board!

    Not really sure if I follow you. Are you solely trying to do this via VBA? Where does the data come from? Where do you enter it? If you have a value as a variable in VBA, you can append simply...
    Code:
    With Sheets("Sheet1").Range("A1")
        .Value = .Value & YourVariableOrValueHere
    End With
    But other than that, not sure what you have. More of an explanation of your process and what you are doing would help.

    HTH
     
  3. yrobins

    yrobins Thread Starter

    Joined:
    Apr 17, 2010
    Messages:
    3
    Thanks for replying:

    What I am trying to convey is that I attempted to enter data manually in one cell. I have hundreds of entries to enter with the pattern described above. I attempted to enter "just" a macro in Excel to do this, but it appears that a macro does not stay in edit mode for me to add two changes of data in one cell. So I was exploring in vba after looking at several posts on a "pause" command. Been looking at code for two days most vba codes only give me half of the results that I am looking for.

    So I can be entering data like this:

    C01Ex04
    C01Ex06
    C02Ex01
    C02Ex06

    Where the 3rd digit equals the chapter and the last 2 digits refer to an exercise number. This all goes into one cell. I would like a prompt or pause, to enter these two data changes in one cell.

    Doses this help?
     
  4. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    I did some simple coding, The yellow area will trigger the macro with a promt if you wish to enter data

    As long as you put text it will add it to the current cell.
    It only works when you use the OK button, I'm sure others have the solution for that but as long as you use the OK and are in the yellow region it does what I think you want.

    Try it and let us know.
     

    Attached Files:

  5. yrobins

    yrobins Thread Starter

    Joined:
    Apr 17, 2010
    Messages:
    3
    Thanks for your help, got the hang of how your prompt code works and this will do the trick.
     
  6. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,452
    Why don't you just enter the data in two different cells and use a third column to concatenate the values? I.e. look up CONCATENATE() function.
     
  7. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,608
    First Name:
    Hans
    Hi Zack, maybe it's more than one cell of data?
     
  8. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,452
    True, Hans, very true. And I may not fully understand the entirety of the scope either. IMHO if there's a simpler way to do things without VBA (which, to me, isn't always the case ;) ) we should at least explore that route. :)
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/917513

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice