| View previous topic :: View next topic |
| Author |
Message |
dummydecoy General User

Joined: 06 Oct 2010 Posts: 39
|
Posted: Mon May 14, 2012 7:49 am Post subject: cell automatically shows Windows username? possible? |
|
|
Is it possible for calc to automatically have A1 show the Windows username?
basically the path, C:\Documents and Settings\JohnSmith
where A1 will automatically show JohnSmith?
If so, how?
I searched and found this:
http://www.oooforum.org/forum/viewtopic.phtml?t=149563
But I don't even know what to do about it.  |
|
| Back to top |
|
 |
ozzie OOo Advocate

Joined: 29 Jul 2010 Posts: 316 Location: victoria
|
Posted: Mon May 14, 2012 8:09 pm Post subject: |
|
|
| Code: | | =MID(CELL("filename");FIND("Users";CELL("filename"))+6;FIND("/";CELL("filename");FIND("Users";CELL("filename"))+6)-(FIND("Users";CELL("filename"))+6)) |
I don't know macros but this in cell A1 should do what you want providing the user name is the next directory after Users.
In my PC the filename looks like this-
'file:///C:/Users/Name/Documents/SomeFile.ods'#$Sheet3 _________________ If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button). |
|
| Back to top |
|
 |
dummydecoy General User

Joined: 06 Oct 2010 Posts: 39
|
Posted: Sat May 19, 2012 5:14 pm Post subject: |
|
|
Aww, on my PC the username is after "Documents and Settings".
for example, C:\Documents and Settings\JohnSmith\My Documents\...
So John Smith is what I need to show up on A1.
Can your code be modified to do that? I know very little of spreadsheets ( |
|
| Back to top |
|
 |
ozzie OOo Advocate

Joined: 29 Jul 2010 Posts: 316 Location: victoria
|
Posted: Sat May 19, 2012 6:11 pm Post subject: |
|
|
Hi dummydecoy
No problems it can be done but your path looks wrong
Copy / paste this formula into a cell of a saved file (ie not an unsaved untitled1 blank spreadsheet) and copy the path name so I can see it.
Change the user & filenames (like I have) if you wish but don't change anything else
_________________ If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button). |
|
| Back to top |
|
 |
|