Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default formulas and colorindex don't work after opentext

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default formulas and colorindex don't work after opentext

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

Sorry.


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



Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataLabel.Font.ColorIndex vs DataLabel.Text (Private Sub does not work in excel 2003) God Itself Charts and Charting in Excel 4 April 22nd 09 03:40 PM
Workbooks.OpenText does not work on XP. HELP !!! [email protected] Excel Programming 6 May 31st 05 03:18 PM
Cell.interior.colorindex - does not work in Excel 97 Ian[_13_] Excel Programming 10 April 5th 05 07:28 PM
After OpenText all pastes from external apps use format from OpenText Jim[_31_] Excel Programming 1 November 8th 03 02:17 AM
OpenText bug ? Orlando Magalhães Filho Excel Programming 0 August 1st 03 04:14 AM


All times are GMT +1. The time now is 01:24 AM.

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

About Us

"It's about Microsoft Excel"