Consulting

Results 1 to 2 of 2

Thread: VBA obfuscate data & find cell

  1. #1
    VBAX Newbie
    Joined
    Jul 2007
    Posts
    1
    Location

    VBA obfuscate data & find cell

    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

    [vba]
    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
    [/vba]

    Edited 24-Jul-07 by geekgirlau. Reason: insert vba tags

  2. #2
    2+2=9 ... (My Arithmetic Is Mental)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •