Naming a reference table for use in a VBA Code

C

CAT

Hello everyone,
I am fairly new to Excell and have no knowledge of VBA programming. I use
Excell 2007.

In reply to a query I made in "Programming", I was asked to do the following:

Name my two columns in the lookup table (AM1:AN29) ColorTable, then copy the
code below, right-click the sheet tab, select "view Code" and paste Code into
the window that appears.

*Where (in which cell) do I insert the word "ColorTable"?

*Where is the sheet tab situated? so that I then right-click and get to
"View Code", in order to paste the Code in said window that will open?

I would be grateful for an answer to those questions as I haven't a clue of
how to proceed.
It also means I can move on with my original query in the Program Section
which is fast disappearing and maybe reword it in simpler terms.

Thank you very much for your help
Cat
 
P

Per Jessen

Hi Cat

To name a range, select the range and goto Insert > Name > Define > Enter
"ColorTable" > OK

The sheet tabs are found at the bottom of the window, normally named Sheet1
, Sheet2 and Sheet3 (used to select a sheet).

Regards,
Per
 
C

CAT

Thank you very much Per, that will save a few blushes if and when I receive
replies to my new query in "Program"

Kind Regards
Cat
 
D

Dave Peterson

Select the worksheet first.

To create the name:
Select AM1:AN29
Then hit ctrl-g (or F5)
and type the name (ColorTable) and hit ok

The worksheet tab is at the bottom of the window. It's the thing that shows you
the name of the worksheet. Just like tabs in a real book (like a dictionary).

Since you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)
 
C

CAT

Hi Dave,

Thank you very much for that Dave, I shall try it when I finally have the
elusive Code!
And thank you also for all the info. I shall read it avidly, I defo need to
brush up :)

Have a great day,
Kind Regards
Cat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top