Thread: change cells
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
David McRitchie David McRitchie is offline
external usenet poster
 
Posts: 903
Default change cells

Hi Wayne,
You could possibly restrict the selection, don't know if that would work for you
or not. I am assuming from your question that you are not using H or any column
past H. I this does not work for your situation please indicate what problems
are encountered..

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rng As Range
If ActiveCell.Column 7 Then
Cells(ActiveCell.Row + 1, 2).Select
Exit Sub
End If
Set rng = Intersect(Selection, Columns("B:G"))
If rng Is Nothing Then
Cells(ActiveCell.Row, 2).Select
Else
rng.Select
End If
End Sub
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"wAyne" wrote in message ...
I hope someone can help .... Excel 2000

I have a spreadsheet where users need to be able to change values in columns
B:G but not in Column A or H...

I could lock the necessary cells and protect the sheet, however....
The users should be able to delete the enitre row if they wish.

I thought of using the Private Sub Worksheet_Change(ByVal Target As Range)
function - but it executes after the cell is changed. and is there a way to
determine if the cell is being changed or the entire row was deleted?

any ideas?

Thanks
wAyne_