Hi,
I am trying to achieve two things with one macro, the first I have solved with the sub below, I now need to populate the file with only the range L2:L11 and not the rest of the data in the sheet, maintaining the rows so each cell contents are on a seperate row in the csv file:
If anyone has a suggestion, I would much appreciate it, am just finding my way round macro's and at this time Friday afternoon, my brain is fried!
TIA,
Duncan
I am trying to achieve two things with one macro, the first I have solved with the sub below, I now need to populate the file with only the range L2:L11 and not the rest of the data in the sheet, maintaining the rows so each cell contents are on a seperate row in the csv file:
Code:
Private Sub CommandButton1_Click()
Dim content As String
Dim rng As Range
Set rng = Range("L2:L11")
Dim Path As String
Dim FileName1 As String
Dim FileName2 As String
Dim FileName3 As String
Path = "C:\Duncans File\"
'Path = "T:\Richards Reports\MG Orders\"
FileName1 = Range("A2")
FileName2 = Range("I2")
FileName3 = Range("H2")
ActiveWorkbook.SaveAs FileName:=Path & FileName1 & "_" & FileName2 & "_" & FileName3 & ".txt", FileFormat:=xlTextMSDOS
End Sub
If anyone has a suggestion, I would much appreciate it, am just finding my way round macro's and at this time Friday afternoon, my brain is fried!
TIA,
Duncan