View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Weird Macro Problem

Try running this as a separate macro:

Sub SetToTrue()
Worksheets("RBRQ2").Range("D34").Value = "TRUE"
Worksheets("RBRQ5").Range("D34").Value = "TRUE"
Worksheets("RBRQ6").Range("D34").Value = "TRUE"
Worksheets("RBRQ7").Range("D34").Value = "TRUE"
End Sub

If it doesn't work, then look at the cells and see if they are merged or
there is otherwise a problem with their formatting (conditional formatting
perhaps).

--
Regards,
Tom Ogilvy

"Bruce001" wrote in
message ...

Hello. I am new here. I have run into a problem with a macro and I don't
have much hair left to pull out. I have a macro that resets default
values to cells on several sheets of my workbook. This works fine
except for a few values and I can't see a pattern other than the only
fields that I am having a problem with are ones I'm trying to set to
"TRUE". The code looks like this:

Worksheets("RBRQ1").Range("B8:B9").ClearContents
Worksheets("RBRQ1").Range("B12").ClearContents
Worksheets("RBRQ1").Range("B10").Value = 1
Worksheets("RBRQ2").Range("D34").Value = "TRUE"
Worksheets("RBRQ3").Range("D34").Value = "FALSE"
Worksheets("RBRQ4").Range("B8:B10").ClearContents
Worksheets("RBRQ4").Range("D34").Value = "FALSE"
Worksheets("RBRQ5").Range("I9:I10").ClearContents
Worksheets("RBRQ5").Range("D34").Value = "TRUE"
Worksheets("RBRQ6").Range("D34").Value = "TRUE"
Worksheets("RBRQ6").Range("D35").Value = "FALSE"
Worksheets("RBRQ6").Range("D36").Value = "FALSE"
Worksheets("RBRQ6").Range("E34").Value = "FALSE"
Worksheets("RBRQ7").Range("D34").Value = "TRUE"
Worksheets("RBRQ7").Range("D35").Value = "FALSE"
Worksheets("RBRQ7").Range("D36").Value = "FALSE"
Worksheets("RBRQ7").Range("D37").Value = "FALSE"
Worksheets("RBRQ7").Range("E34").Value = "FALSE"

The lines in red are the only ones that don't get set. I ran the debug
on this subroutine and at each of these three lines, it would jump to
that sheets macros and execute the code found first??? (Strangely
enough, this code found should set the values to what I want, but it
doesn't seem to set them.)

I have run this under Excel 2003 and Excel 2000 and the results are the
same. Any help would be appreciated.


--
Bruce001
------------------------------------------------------------------------
Bruce001's Profile:

http://www.excelforum.com/member.php...o&userid=26630
View this thread: http://www.excelforum.com/showthread...hreadid=399045