coloring cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am trying to fill up values in a worksheet with hundreds of columns and
rows.
For every new session of data entry a macro is automatically run protecting
the worksheet leaving only one column unprotected, the one in which data will
be entered. Column B holds the description of all items. Is it possible to
highlight the corresponding cell in column B while the target cell changes
position in the unprotected column?
This will help to make data entry much easier and avoid mistakes in entering
values to the wrong row.

Thanks
 
Nick,

Try this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Me.Unprotect
Columns("B:B").Interior.ColorIndex = xlColorIndexNone
Cells(Target.Row, "B").Interior.ColorIndex = 35
Me.Protect

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Why not use freeze panes under the window menu item and slide the data entry
column next to column B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top