• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 100
  • Last Modified:

How do I create a Define in Excel VBA ?

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
Tocogroup
Asked:
Tocogroup
1 Solution
 
NorieData ProcessorCommented:
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
 
TocogroupAuthor Commented:
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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now