formulas and colorindex don't work after opentext

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

I am opening a text file with OpenText but when I do, and then try setting
the background color, the row color doesn't change. Yet when I set the
color from a different sub, executed AFTER the initial sub, the color is
set. Anyone experience weirdness like this before?

This is the opentext line:

Workbooks.OpenText Filename:=varFileName, DataType:=xlFixedWidth,
fieldinfo:=Array(Array(0, 1), Array(9, 2), Array(21, 3), Array(32, 1),
Array(40, 1), Array(48, 1), Array(54, 1), Array(65, 1), Array(74, 1),
Array(83, 1), Array(89, 1), Array(100, 1))

and the formula and color settings:

Cells(r, 1).EntireRow.Interior.ColorIndex = 5

yet these subs work - after the initial sub is finished - but not when
called from within the initial sub.

Sub a()
setrowcolor 5, 3
End Sub



Sub setrowcolor(rownum, rowcolor)
Cells(rownum, 1).EntireRow.Interior.ColorIndex = rowcolor
End Sub

Thanks,
Keith
 
Please forgive my error. I found a logic error which prevented the code in
that area from being executed.

Sorry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top