Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 3
Default How do I use variables in Excel?

How Can I accomplish this, say this is field A1:

The %product% only costs %price%. Order today, we only have %qty% left!

--------------
Obvoiusly the words enclosed in % % are the variables that I want replaced.
Is there way that I can make fields B, C, and D equal the corresponding variables?

For example,

B1= Dog collar
C1= $9.99
D1= 20

So then A1 becomes:

The dog collar only costs $9.99. Order today, we only have 20 left!

I'm open to trying ANY method that can allow me to use variables in Excel.

Thanks.
  #2   Report Post  
Dave O
 
Posts: n/a
Default

Yes- check out Named Ranges in the Help feature. I'm not sure if Excel
will allow you to call the range %Product%, but it will definitely
allow you to call it Product.

Once you have named the ranges your formula would be
="The " & Product & " only costs " & Price &". Order today, we only
have " & Qty & " left!"

  #3   Report Post  
Dave O
 
Posts: n/a
Default

Click Insert Name Define and a window appears. Type your variable
name in the top and mouse click the appropriate cell.

  #4   Report Post  
Junior Member
 
Posts: 3
Default

Quote:
Originally Posted by Dave O
Click Insert Name Define and a window appears. Type your variable
name in the top and mouse click the appropriate cell.
Ok, I got it done but now I'm trying to save it as a csv file without saving the coulmn that has the references.

So I looked online and found out about referencing from another worksheet.
Example:

=(Sheet2!A1:A8)

The problem is, the field will only show A1.

It seems that I need to add a math function:

=SUM(Sheet2!A1:A8)

In order for it to work. But I don't need math, I just need to text. How do you reference a range of text from a different worksheet?

Thanks!
  #5   Report Post  
CyberTaz
 
Posts: n/a
Default

Not sure I'm clear on the issue, but since nobody has responded I'll give it
a shot. Post back with more info if this doesn't hit the mark.

When you create the link (=Sheet2!A1:A8), the entire content of all 8 cells
*does not* get entered into the *one* cell containing the formula. On the
sheet where you created the link formula you need to drag the fill handle
(small nub at lower right corner of cell selector) right as many columns as
the data occupies on the source sheet (& then down as many rows as the data
occupies on the source sheet if more than one record) to display all the
data. The only content that gets copied out to your csv is what is displayed
on your sheet when you create the file.

FWIW, when I do something like this I usually just use =Sheet1!A1 as my
formula & then use the fill handle to copy it over & down to the necessary
number of columns & rows.

HTH |:)

"XUT67" wrote:


Dave O Wrote:
Click Insert Name Define and a window appears. Type your variable
name in the top and mouse click the appropriate cell.


Ok, I got it done but now I'm trying to save it as a csv file without
saving the coulmn that has the references.

So I looked online and found out about referencing from another
worksheet.
Example:

=(Sheet2!A1:A8)

The problem is, the field will only show A1.

It seems that I need to add a math function:

=SUM(Sheet2!A1:A8)

In order for it to work. But I don't need math, I just need to text.
How do you reference a range of text from a different worksheet?

Thanks!


--
XUT67



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you define variables in excel? BigRon Excel Discussion (Misc queries) 6 April 16th 05 08:47 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
Excel Files Acting Weird Anat Excel Discussion (Misc queries) 0 March 29th 05 03:07 AM
Excel error - Startup (and Acrobat PDFMaker) gxdata Setting up and Configuration of Excel 0 February 4th 05 03:44 AM
Excel 2002 and 2000 co-install. Control Which Starts ? cnuk Excel Discussion (Misc queries) 2 January 17th 05 08:07 PM


All times are GMT +1. The time now is 08:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"