ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   coloring cells (https://www.excelbanter.com/excel-programming/307275-coloring-cells.html)

nick

coloring cells
 
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



Bob Phillips[_6_]

coloring cells
 
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)

"NiCK" wrote in message
...
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





Tom Ogilvy

coloring cells
 
Why not use freeze panes under the window menu item and slide the data entry
column next to column B.

--
Regards,
Tom Ogilvy

"NiCK" wrote in message
...
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






All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com