Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macros in excel

Status
Not open for further replies.

mvpdep

Programmer
Nov 11, 2005
21
CA
Hi all I want to be sure I'm asking the right question.

I want to place a button on my main spreadsheet page call it Companies.

So I place a button on the page label it Companies how do I create a macro that when this button is clicked it will take me to another sheet called companies?

Also if anyone could point me to any websites or forums or threads that can give me some basics re: macros it would be greatly appreciated thanks.

 
Macro questions generally belong in forum707, the VBA Visual Basic for Applications (Microsoft) Forum.

This could certainly be done with a macro, but since you asked in this forum - have you looked at using a hyperlink?

Go to Insert > Hyperlink. In the Text to Display , type in 'Companies'. Pick Place in this document from the list on the left, then select the corresponding sheet name.

Voila!

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
First create the macro by recording it or press ALT+F11 on your keyboard to invoke VB Editor. Go to Insert, Module. Paste the following macro

Sub shselect()
Sheets("Companies").Select
End Sub

On your XL sheet, go to View, Toolbars, Forms. Create a button. When you get a pop-up, link the macro to the button

Me transmitte sursum, Caledoni!
 
That is a great work around thank you. And of course it does work just fine. Possibly you could assist me with another question if you didn't mind:

Sheet 1 - Contains info for companies (name, contact, phone etc.)
Sheet 2 - Is a call tracking sheet. In column A the user will select who they are calling from a drop down selection box.

How do I fill a selection box with data from Sheet 1 just the company Name.

Once there can I then populate the city and phone of the company into Sheet 2 based on user selection.

If you could assist here that would be great and thanks for the hyperlink tip.

Cheers.
 
With a sorted, unique list, use the VLOOKUP formula. Post back if you need more help with it. :)

-----------
Regards,
Zack Barresse
 
I am sorry I am a bit new at this but what is a unique list and vlookup formula? No idea thanks.

James
 
a "unique list" is just a list of the things you want returned, each listed only once. A list of unique items.

For help on the VLookup, see Excel's help file.

Post back with any specific questions.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Did you read the Help files on VLOOKUP?? It even has examples. The thing with the unique values is if you have multiple values of (in your case) who is calling then a VLOOKUP won't work for you as it will only grab one instance.

For example, you have this data in Sheet1 in columns A:D...

[tt]
Name Age Company State
Joe 45 ABC, Inc. WA
Dan 32 Wazoo AL
Todd 58 Nike OR[/tt]

Then on Sheet2, say in A2 you enter (or from a drop down of names) Dan. In B2 you can enter ..

=VLOOKUP(A2,Sheet1!$A:$D,2,0)

..and in C2..
=VLOOKUP(A2,Sheet1!$A:$D,3,0)

.. and in D2..
=VLOOKUP(A2,Sheet1!$A:$D,4,0)

See if that helps.

-----------
Regards,
Zack Barresse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top