View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Enter NA() into All Blank Cells in Range

You have put an apostrophe before the line that calculates n
--
Gary''s Student - gsnu200773


"ryguy7272" wrote:

I'm up to this point now:
CountRows = Sheets("INPUTS").Range("AA1")
Range("A65536").Select
Selection.End(xlUp).Select
Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 4)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
'n = Cells(CountRows, 1).End(xlUp).Row
Set R = Range("B3:E" & n).SpecialCells(xlCellTypeBlanks)
For Each rr In R
rr.Formula = "=NA()"
Next

It selects all of the cells that I want to evaluate for empty and nonempty.
I get an error on this line:
Set R = Range("B3:E" & n).SpecialCells(xlCellTypeBlanks)

I just need to fill the active range with "=NA()" and I should be done. Can
anyone find the problem now? I don't see it.


Thanks for all the help,
Ryan--

--
RyGuy


"Peter T" wrote:

try this

If Item.Value = MyVar Then Item.Value = CVErr(xlErrNA)

Regards,
Peter T


"ryguy7272" wrote in message
...
I have dates in Column A, and data in Column B:E.

I am using this little snippet of code to insert NA into cells to force my
graph to plot correctly:

Sheets("GRAPH CURRENT").Select
MyVar = ""
For Each Item In Range("B3:E3")
If Item.Value = MyVar Then Item.Value = "=NA()"
Next Item

The graph is based on this tip:
http://j-walk.com/ss/excel/usertips/tip024.htm

So, I'm plugging NA into cells that would otherwise be zero. I used this
code to fill down with NA in each column:

Range("B3").Select
Selection.AutoFill Destination:=Range _
(Selection, Selection.Offset(0, 1).End(xlDown).Offset(0, -1))

However, there are some cells towards the bottom of the list in B:E,

before
the dates in Column A end. So, I get some zeros under the actual data! I

'm
trying to come up with a way of getting to the end of the used range in
Column A, offset 1 column, and select all cells from this current cell up

to
B3, and fill all blanks with "=NA()". For instance, select B600:B3, and
enter =NA() into all blanks, knowing that the B600 changes constantly.

Then,
move to Column C, D, and E. Does anyone have a good idea as to how to do
this?

Regards,
Ryan--


--
RyGuy