Solved

How do I create a Define in Excel VBA ?

Posted on 2014-11-12
2
94 Views
Last Modified: 2014-11-12
Hi All,

I am opening a file in my VBA procedure and assigning the filename to a string variable - sFileName.

How do I create a Define in VBA which will allow me to enter the Define as a cell eg =sFileName

Thanks
0
Comment
Question by:Tocogroup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
Norie earned 500 total points
ID: 40437136
What do you mean by a 'Define'?

If you wanted to put the filename in a cell on a worksheet you could use this.
Sheets("Sheet1").Range("B2").Value = sFileName

Open in new window

0
 

Author Closing Comment

by:Tocogroup
ID: 40437143
Yes, you're right. I think I overcomplicated the solution. Once I've got the filename then I can display it in whatever cell I want.
Thanks for the clarity.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question