Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I create a Define in Excel VBA ?

Posted on 2014-11-12
2
Medium Priority
?
97 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

705 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