Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing Diagonal Lines on worksheet
This is the code I wrote:
Private Sub chkboxE4NA_Click() unprotect the sheet first ActiveSheet.Unprotect 'Draws a line accross both pages in Worksheet E4 and directs the user to E5 ActiveSheet.Shapes.AddLine(0#, 1.5, 543.75, 713.25).Select Selection.ShapeRange.Line.Weight = 2.25 Selection.ShapeRange.Flip msoFlipHorizontal ActiveSheet.Shapes.AddLine(546.75, 1.5, 1073.25, 714#).Select Selection.ShapeRange.Line.Weight = 2.25 Selection.ShapeRange.Flip msoFlipHorizontal €˜Check box on page two chkE4NA1.Value = True 'Protect the sheet ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveSheet.EnableSelection = xlUnlockedCells €˜Move the user to Worksheet E5 Sheets("E5").Select End Sub ________________________ Basically as the user goes down the workbook and finds out he does not need to fill out worksheet E4, all he has to do is check the checkbox and this crosses out page one and two and then directs the user to the next worksheet. Two problems: ONE: if the user decides after he checks the checkbox to go back and fill out the worksheet, he has to manually delete the lines. How can this be done with a simple unchecking of the checkbox? TWO: if the user unchecks the checkbox, this action draws a new set of diagonal lines overlaping the first ones. If problem one can not be solved, how can the repetition of the diagonal lines be avoided when the user unchecks the checkbox? Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing Diagonal Lines on worksheet
This is sort of makeshift, but give it a try. Change the sheet number to
suit your requirement. Sub d() ActiveSheet.Unprotect For Each shp In Sheets(1).Shapes '<<<validate sheet nbr. If shp.Type = 9 Then shp.Delete End If Next End Sub "Memphis" wrote in message ... This is the code I wrote: Private Sub chkboxE4NA_Click() unprotect the sheet first ActiveSheet.Unprotect 'Draws a line accross both pages in Worksheet E4 and directs the user to E5 ActiveSheet.Shapes.AddLine(0#, 1.5, 543.75, 713.25).Select Selection.ShapeRange.Line.Weight = 2.25 Selection.ShapeRange.Flip msoFlipHorizontal ActiveSheet.Shapes.AddLine(546.75, 1.5, 1073.25, 714#).Select Selection.ShapeRange.Line.Weight = 2.25 Selection.ShapeRange.Flip msoFlipHorizontal 'Check box on page two chkE4NA1.Value = True 'Protect the sheet ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveSheet.EnableSelection = xlUnlockedCells 'Move the user to Worksheet E5 Sheets("E5").Select End Sub ________________________ Basically as the user goes down the workbook and finds out he does not need to fill out worksheet E4, all he has to do is check the checkbox and this crosses out page one and two and then directs the user to the next worksheet. Two problems: ONE: if the user decides after he checks the checkbox to go back and fill out the worksheet, he has to manually delete the lines. How can this be done with a simple unchecking of the checkbox? TWO: if the user unchecks the checkbox, this action draws a new set of diagonal lines overlaping the first ones. If problem one can not be solved, how can the repetition of the diagonal lines be avoided when the user unchecks the checkbox? Thank you |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing Diagonal Lines on worksheet
Thank you so much JLGWhiz, this does the trick...
If I may say it "You Are The Man!" Thanks! Memphis "JLGWhiz" wrote: This is sort of makeshift, but give it a try. Change the sheet number to suit your requirement. Sub d() ActiveSheet.Unprotect For Each shp In Sheets(1).Shapes '<<<validate sheet nbr. If shp.Type = 9 Then shp.Delete End If Next End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing Diagonal Lines on worksheet
Check your other post, too.
Memphis wrote: This is the code I wrote: Private Sub chkboxE4NA_Click() unprotect the sheet first ActiveSheet.Unprotect 'Draws a line accross both pages in Worksheet E4 and directs the user to E5 ActiveSheet.Shapes.AddLine(0#, 1.5, 543.75, 713.25).Select Selection.ShapeRange.Line.Weight = 2.25 Selection.ShapeRange.Flip msoFlipHorizontal ActiveSheet.Shapes.AddLine(546.75, 1.5, 1073.25, 714#).Select Selection.ShapeRange.Line.Weight = 2.25 Selection.ShapeRange.Flip msoFlipHorizontal €˜Check box on page two chkE4NA1.Value = True 'Protect the sheet ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveSheet.EnableSelection = xlUnlockedCells €˜Move the user to Worksheet E5 Sheets("E5").Select End Sub ________________________ Basically as the user goes down the workbook and finds out he does not need to fill out worksheet E4, all he has to do is check the checkbox and this crosses out page one and two and then directs the user to the next worksheet. Two problems: ONE: if the user decides after he checks the checkbox to go back and fill out the worksheet, he has to manually delete the lines. How can this be done with a simple unchecking of the checkbox? TWO: if the user unchecks the checkbox, this action draws a new set of diagonal lines overlaping the first ones. If problem one can not be solved, how can the repetition of the diagonal lines be avoided when the user unchecks the checkbox? Thank you -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing Diagonal Lines on worksheet
Hello Dave and Discussion Groups Forum, I apologize to the community for the inconvenience. The other post was intended to be the original post. As I typed and hit the send key, the post window replied back with an error saying that there was an error and that my post did not go though. The only way I found out the first post had gone through was when I got a reply alert in my in box, from two separate postings. I do indeed appreciate the knowledge base in the Discussion groups and do not want to jeopardize my membership. Regards, Memphis "Dave Peterson" wrote: Check your other post, too. Memphis wrote: Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing Diagonal Lines on worksheet
There was another method in that other thread. I'd still suggest you look at
it--even if you don't use it. If you can't find it, you can use google to search through groups. http://groups.google.com/advanced_se...blic.excel. * Give it enough information (you as the author, maybe a keyword or date) and you'll find it. Memphis wrote: Hello Dave and Discussion Groups Forum, I apologize to the community for the inconvenience. The other post was intended to be the original post. As I typed and hit the send key, the post window replied back with an error saying that there was an error and that my post did not go though. The only way I found out the first post had gone through was when I got a reply alert in my in box, from two separate postings. I do indeed appreciate the knowledge base in the Discussion groups and do not want to jeopardize my membership. Regards, Memphis "Dave Peterson" wrote: Check your other post, too. Memphis wrote: Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Removind diagonal lines created on sheet | Excel Discussion (Misc queries) | |||
Diagonal error lines in a scatter? | Charts and Charting in Excel | |||
Need diagonal lines behind printed cells. | Excel Discussion (Misc queries) | |||
How do I place diagonal lines in a cell in Excel. | Excel Discussion (Misc queries) | |||
Diagonal Lines on UserForms? | Excel Programming |