Remove quotes from text pulled from CSV

Dag79

New Member
Joined
Jul 15, 2015
Messages
2
Hi all,

Need to pick someone else's brain on this. The problem is very simple: I have a macro which is extracting information from a csv report and populating a spreadsheet. The problem I have is that when it does so the text populated on the cells are all double quoted:

"14/07/2015 9:51:37"

Here is the code:

Code:
Sub OpenCSV()
    Dim FilePath As String
    FilePath = "D:\VBA Test\LastLogonReport.csv"
    
    Open FilePath For Input As #1
    
    Cells(1, 1).Select
    
    rownb = 0
    
    Do Until EOF(1)
             
        Line Input #1, LineFromCSV
    
        LineItems = Split(LineFromCSV, ",")
               
        ActiveCell.Offset(rownb, 0).Value = LineItems(2)
        ActiveCell.Offset(rownb, 1).Value = LineItems(6)
        
        rownb = rownb + 1
        
    Loop
    
      
    
    Close #1
End Sub

I'm sure is something really simple but can't find a straight answer for that!

Thanks all.
D.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
instead of code, cant you just click the DATA tab, Import from Text icon?

Well not quite!
This is only part of the code, the part I'm struggling with. That report is a Powershell script generated daily and the spreadsheet gather information from it and make some arrangements to be sent via email to the HR departments. Basically it monitors who's logged in today onto the network and gives a report to HR.

Also want to test some code, so it's good for me to learn!;)

But thanks anyway :cool:
 
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top