Results 1 to 1 of 1

Cant select entire sheet

Threaded View

leighmills33 Cant select entire sheet 03-28-2008, 10:13 AM
  1. #1
    Forum Contributor
    Join Date
    03-18-2008
    Posts
    162

    Cant select entire sheet

    hi guys can someone help me with this code?



    Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    
    'more than one cell selected
    If Target.Count > 1 Then Exit Sub
    'use Static because when declared at the procedure level,
    'it will not lose it's content when the program is not in their procedure
    Static LastChanged As String    'last cell address
    Application.ScreenUpdating = False
    
    If LastChanged = Empty Then
        LastChanged = ActiveCell.Address
    End If
    'clears previous highlight
    With Range(LastChanged)
        .EntireRow.Interior.ColorIndex = xlNone
    End With
    'highlights active cell row
    With Target
        .EntireRow.Interior.ColorIndex = 15
        
    End With
    LastChanged = Target.Address
    
    Application.ScreenUpdating = True
    
    End Sub

    the problem im getting is i cant seem to select the entire sheet, and i want to select parts of the sheet so i can lock certain cells.

    Thanks
    Last edited by VBA Noob; 03-28-2008 at 02:19 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1