Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i didn't test your whole macro, but this stands out to me as
incorrect...... FName = "MyPath&MyFile" should be: FName = "MyPath" & "MyFile" hope this helps! susan timmulla wrote: Can anyone help me with the following code. I'm having trouble setting the FName variable using two other variables (MyPath and MyFile. MyPath variable "C:\Documents and Settings\tmullady\Desktop\" MyFile Variable contents in cell B3 in my spreadsheet The end result should be the FName variable should create the proper file path. Public Sub Testing() Dim MyFile As String MyFile = Cells(3, 2).Text Dim MyPath As String MyPath = "C:\Documents and Settings\tmullady\Desktop\" Dim FName As String Dim FNum As Integer Dim Rng As Range FName = "MyPath&MyFile" 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 Any help would be appreciated -- Regards, timmulla |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting Multiple Variables with a loop | Excel Discussion (Misc queries) | |||
Need help with setting variables | Excel Programming | |||
Setting several variables at the same time | Excel Programming | |||
Setting variables to Nothing | Excel Programming | |||
Setting a print range using variables | Excel Programming |