View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default A little excel vb help ?

Post your whole code and tell us the overall objective, this post is very
confusing.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Isis" wrote in message
...
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