Re: merged cells - code glitch
- From: "David Biddulph" <groups [at] biddulph.org.uk>
- Date: Tue, 9 Oct 2007 21:45:51 +0100
I doubt whether you really need merged cells for the readability of the
printoit. Have you looked at "Centre Across Selection" in Format/ Cells/
Alignment?
--
David Biddulph
"Horatio J. Bilge, Jr." <HoratioJBilgeJr@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:DDFD263A-F657-494A-A2E2-B3CBF8D7F227@xxxxxxxxxxxxxxxx
I considered unmerging the cells, but I'm trying to avoid it, because the
spread*** also serves as a printable form, and that would affect the
readability of the printout. Since this is the only problem that has
arisen
from the use of the merged cells, I was hoping that I could add a line to
the
code to work around it.
Maybe something like:
IF {Del key is pressed} THEN Target.Formula = ...
Would that work? I'm not sure exactly how to write it in code.
~ Horatio
"Duke Carey" wrote:
Merged cells are the worst plague that Microsoft has loosed on
unsuspecting
users.
The best course of action is to unmerge the cells. There's almost always
a
better way of doing something WITHOUT merged cells.
"Horatio J. Bilge, Jr." wrote:
I have a glitch in my code. The purpose of the code is to protect the
formulas in cells on Sheet1, while still allowing a specific text entry
("Ex"). And if a user then chooses to delete the "Ex" the cell will
revert
back to the original formula, by retrieving it from Sheet3.
My code works well in single cells. But I have in some merged cells
(e.g.,
E5 is merged from E5 and E6), and there is a glitch in the code. In
those
cells, pressing the delete key actually deletes the contents of the
cells,
and results in an error. If I delete the cell by pressing 'backspace'
and
then 'enter' the code works as expected.
Here is my code:
If Application.Intersect(Target, Range("E5:E49")) Is Nothing Then
Exit Sub
End If
If Target.Value <> "Ex" Then
Application.EnableEvents = False
Target.Formula = Sheets("Sheet3").Cells(Target.Row,
Target.Column).Formula
Application.EnableEvents = True
End If
Exit Sub
.
- Follow-Ups:
- Re: merged cells - code glitch
- From: Horatio J. Bilge, Jr.
- Re: merged cells - code glitch
- Prev by Date: Re: Is it possible for me to have an alert pop-up when I open a do
- Next by Date: Re: UserInterfaceOnly & Password Protection
- Previous by thread: Re: Hiding columns in Excel -
- Next by thread: Re: merged cells - code glitch
- Index(es):