Akhilesh28
New Member
- Joined
- Apr 12, 2021
- Messages
- 2
- Office Version
- 2016
- Platform
- Windows
Hello guys,
This us my 1st post.
Please do the needful
I am trying to concatenate 2 columns out of 7 and save those columns data in a file seperated by comma.
E.g Cell A2 has abc and Cell E2 has 123.
A3 has pqr and E3 has 789
Expected Result:
abc,123
pqr,789
But I am getting
"abc,123
","pqr,789
",
Code:
Private sub export()
Dim myfile as string, count as long, cellvalue as variant, i as integer
Myfile = location of file
Count= worksheetfunction.CountA("A1", range("a1").end(xldown))
Open Myfile for output as #1
For i =2 to count
Cellvalue = rng.cells(i,1).Value & ','& rng.cells(i,5).Value & vbCrLf
Write #1, cellvalue
Next i
Close #1
End sub
Please ignore the cases. I typed in bit hurry
This us my 1st post.
Please do the needful
I am trying to concatenate 2 columns out of 7 and save those columns data in a file seperated by comma.
E.g Cell A2 has abc and Cell E2 has 123.
A3 has pqr and E3 has 789
Expected Result:
abc,123
pqr,789
But I am getting
"abc,123
","pqr,789
",
Code:
Private sub export()
Dim myfile as string, count as long, cellvalue as variant, i as integer
Myfile = location of file
Count= worksheetfunction.CountA("A1", range("a1").end(xldown))
Open Myfile for output as #1
For i =2 to count
Cellvalue = rng.cells(i,1).Value & ','& rng.cells(i,5).Value & vbCrLf
Write #1, cellvalue
Next i
Close #1
End sub
Please ignore the cases. I typed in bit hurry