wigdawei
07-23-2007, 06:20 AM
I am using Excel to tabulate scores for my employees. We work in a very busy and open office, so there is a need to be able to obfuscate the scores, but also help keep from losing my place while punching the scores.
I would like it to be able to return to the last cell that I was punching a score in... I believe I have become confused in using "ActiveCell.SpecialCells(xlLastCell).Select" as I think it wants to reselect the last used range as the last cell... How do I find the last used cell before the range of cells was selected? I have also used " x= cells(Rows.count,2).end(xlUP).row" followed by "cells(x+1,2).select", but still with no luck... Perhaps the problem lies in how I have set up mu Hide_Scores macro in the first place?
Thanks,
David
Sub Hide_Scores()
Range("B15:EU35").Select
ActiveSheet.Unprotect
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.StrikeThrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 2
End With
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
x = ActiveSheet.UsedRange.Rows.Count
ActiveCell.SpecialCells(xlLastCell).Select
End Sub
Edited 24-Jul-07 by geekgirlau. Reason: insert vba tags
I would like it to be able to return to the last cell that I was punching a score in... I believe I have become confused in using "ActiveCell.SpecialCells(xlLastCell).Select" as I think it wants to reselect the last used range as the last cell... How do I find the last used cell before the range of cells was selected? I have also used " x= cells(Rows.count,2).end(xlUP).row" followed by "cells(x+1,2).select", but still with no luck... Perhaps the problem lies in how I have set up mu Hide_Scores macro in the first place?
Thanks,
David
Sub Hide_Scores()
Range("B15:EU35").Select
ActiveSheet.Unprotect
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.StrikeThrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 2
End With
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
x = ActiveSheet.UsedRange.Rows.Count
ActiveCell.SpecialCells(xlLastCell).Select
End Sub
Edited 24-Jul-07 by geekgirlau. Reason: insert vba tags