Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Can system variables be used inside Excel

Can the system variables like %HOMEPATH% be used inside of Excel? If so then
how?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Can system variables be used inside Excel

You can write your own User Defined Functions that you can use in Excel. For
example place this code in a standard code module

public function HomePath() as string
HomePath = thisworkbook.path
end function

In any cell type =HomePath()

You can also use environ to get system data

public function LoginName() as string
LoginName = environ("UserName")
end function
--
HTH...

Jim Thomlinson


"John F" wrote:

Can the system variables like %HOMEPATH% be used inside of Excel? If so then
how?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Can system variables be used inside Excel

Thanks Got it

"Jim Thomlinson" wrote:

You can write your own User Defined Functions that you can use in Excel. For
example place this code in a standard code module

public function HomePath() as string
HomePath = thisworkbook.path
end function

In any cell type =HomePath()

You can also use environ to get system data

public function LoginName() as string
LoginName = environ("UserName")
end function
--
HTH...

Jim Thomlinson


"John F" wrote:

Can the system variables like %HOMEPATH% be used inside of Excel? If so then
how?

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 I open an Excel file on XP system, saved on a Vista system JLS7 Excel Discussion (Misc queries) 3 December 2nd 08 04:21 AM
System Environment Variables bdickert Excel Discussion (Misc queries) 1 October 8th 06 08:40 PM
System Environment Variables bdickert Excel Discussion (Misc queries) 9 October 7th 06 09:34 PM
variables inside a formula?? zerosleep Excel Programming 2 March 1st 06 03:33 PM
System variables Slava. Excel Programming 4 March 9th 05 04:48 PM


All times are GMT +1. The time now is 06:10 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"