Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with code
Hmm... that's no good eh?
I think that I said that you could use Environ("username") to get the Windows User Name of the person who's currently logged in to the PC and then go from there. Cheers, Jason Lepack timmulla wrote: I didn't see any comments in your post. -- Regards, timmulla "timmulla" wrote: I have a spreadsheet with the following inputs. Cell B1 = names (Adam, Tim , Jerry , Joe, John, Bill, Jen) Cell B2 = Day of the week (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) The selections in cell B1 and B2 are automatically generating the appropriate data in cell B3 and range B5:B10. I then have the following the code to write range B5:B10 to a text file: Sub Macro5() Dim FName As String Dim FNum As Integer Dim Rng As Range FName = "C:\Documents and Settings\tmullady\Desktop\Test.txt" FNum = FreeFile Open FName For Output Access Write As #FNum Print #FNum, Range("B3").Text For Each Rng In Range("B5:B10") Print #FNum, Rng.Text Next Rng Close #FNum End Sub I created a form that enables a user to select the day of the week, which will populate cell B2. I need help writing code that will automatically change the contents in cell B1 for each of the people (Adam, Tim , Jerry , Joe, John, Bill, Jen) and then write the contents range B5:B10 to a text file. Basically, I want a user to select a day in the week which will automatically generate 7 different text files. The text files need to be named based on the text in cell B3. Any help would be appreciated. -- Regards, timmulla |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
Excel code convert to Access code - Concat & eliminate duplicates | Excel Programming | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming |