LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 51
Default A little excel vb help ?

I am trying to read each row in an excel sheet and write i tout to a CSV
file - got most of that working.

While I am reading each cell, I am reformatting some cells (concatenating
etc) before writing it out. I was using the following line to get the
Text value from a cell;

Selection.Cells(RowCount, ColumnCount).Text

but I now don't want to use a Selection - how do I just refer to a single
cell ?

I am now going to loop through the Rows only - then I will gather the
contents of each cell in a Row into one long string.

So I want something like;

strVariable = Cell(RowCount, 1)
strVariable = Trim(strVariable) & Cell(RowCount, 2) & _
Cell(RowCount, 3) & _
Cell(RowCount, 4) & ","
Print #FileNum, strVariable;

but I don't think Print Cell(RowCount, 1) is the right VB code.

Any help appreciated.
Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"