Solved

How do I create a Define in Excel VBA ?

Posted on 2014-11-12
2
83 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
2 Comments
 
LVL 33

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.Range Set 25 76
Excel VBA get Access table names with ADO 2 20
how to transpose my example data using VBA 9 33
sumifs excel 2013 3 14
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

770 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