Reding .CSV file in VB

Reding .CSV file in VB

Page 1 of 1

1 Replies - 4243 Views - Last Post: 12 December 2008 - 03:41 PM Rate Topic: -----

#1 myself.panku  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-December 08

Reding .CSV file in VB

Posted 12 December 2008 - 11:01 AM

Hi All

i need the code written in VB where i m reading a perticuler cell's value from .CSV file and writing that value into a perticuler cell into XLS file.

IT IS VERY VERY VERY URGENT...

I NEED UR HELP....


Thanks & Regards

Pankaj Bahuguna
Is This A Good Question/Topic? 0
  • +

Replies To: Reding .CSV file in VB

#2 rbrewer_phca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 30-November 08

Re: Reding .CSV file in VB

Posted 12 December 2008 - 03:41 PM

Here is a short example. If you need more info let me know. I have several applications where I use csv files to populate Excel worksheets.

Public objXcl As Excel.Application
Set objXcl = Excel.Application
objXcl.Workbooks.Add
objXcl.Sheets(1).Select

‘Open csv file, then read
Do Until EOF(nFileNbr)
Input #nFileNbr, sTextField(0), sTextField(1), sTextField(2), sTextField(3)

With objXcl
Range("B1").Select
.Range("B1").Value = sTextField(0)
Range("B2").Select
.Range("B2").Value = sTextField(1)
Range("B3").Select
.Range("B3").Value = sTextField(2)
End With
Loop

Hope this helps,
Ron Brewer
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1