Re: Returning last button pushed in Excel 7

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: sth (s_tally_ho_at_hotmail.com)
Date: 04/09/04


Date: 9 Apr 2004 05:36:37 -0700

Bob, Your code worked flawlessly in some trial runs in Excel 7. Thx
much for the assistance!

=====

"Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message news:<uGsPD3WHEHA.2876@TK2MSFTNGP09.phx.gbl>...
> Try something like
>
> Sub MyMacro()
> Select Case Application.Caller
> Case "Text Box 1": ActiveCell.Value = "aaa"
> Case "Text Box 2": ActiveCell.Value = "bbb"
> Case "Text Box 3": ActiveCell.Value = "ccc"
> Case Else: ActiveCell.Value = "zzz"
> End Select
>
> End Sub
>
> --
>
> HTH
>
> Bob Phillips
> ... looking out across Poole Harbour to the Purbecks
> (remove nothere from the email address if mailing direct)
>
> "sth" <s_tally_ho@hotmail.com> wrote in message
> news:99b53ddd.0404080522.2defeebc@posting.google.com...
> > I am not a programmer by trade, so plz bear with me.
> >
> > I have a spreadsheet containing various macro-linked buttons (actually
> > text boxes) that automate the entry of various strings of text into
> > the spreadsheet. Text-Button1 would enter "aaaa," Text-Button2 would
> > enter "bbbb," etc.
> >
> > I want to maintain the current user simplicity of only one click to
> > enter the respective text for that button. Now I have a separate macro
> > routine for each button, but I would like to simply the code without
> > complicating things for the user, so, if it is possible, I would like
> > to assign the same macro routine to each of these buttons and then
> > depending upon which button is pressed, enter the text that is
> > associated with that button. However, I cannot figure out how to store
> > the name of the last-pressed text-button in a variable to use to
> > branch to the respective text strings.
> >
> > This command does not work apparently because the text box is not
> > actually selected when the code is running: xxx = Selection.Name
> >
> > Although I have access to a more recent version of Excel, I would like
> > to maintain compatibility with Excel 7 (Excel for Windows 95).
> >
> > Possible?
> >
> > Plz help! Thx.



Relevant Pages

  • Re: Code looping through files new line
    ... Bob neglected to mention one thing. ... have zero experience with importing non-Excel files into Excel. ... Otto and I have talking this morning and here are some clarifications ... Next Otto asked me to clean out the folder and then create new .xls files ...
    (microsoft.public.excel.programming)
  • Re: Fourier Analysis Scaling
    ... > When I run the data set, Excel returns much bigger values: ... Hi Bob. ... > Now I anticipate an application for the Fourier tool in Excel. ...
    (microsoft.public.excel)
  • Re: Spell Number Script
    ... Bob, Here is a previous post by Norman Harker on the subject. ... If you want numbers to be translated in Thai then there's an Excel function ...
    (microsoft.public.excel)
  • Re: xla Installation
    ... Thanks again Bob, but putting the add-in file on a server won't work, as we ... tell each user to manually add the add-in using "Tools / AddIns" nor do it ... > When an addin is installed, it becomes part of the Excel client (or more ... >> We install software using a deployment tool. ...
    (microsoft.public.excel.programming)
  • Re: Macros & alternatives
    ... What I mean is how would they "remove the ability to change it"? ... > They would install Excel with a high setting, ... > Bob Phillips ... >>> system variables, etc., and within Excel to run macros by setting the ...
    (microsoft.public.excel.programming)