LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Allow macro to work for a group of cells but not the other cells

Hello,

I am working on a workbook where a group of cells must change with a
macro button which will be triggered by a user. Insert value and
color.
The value is used in a formel in another cell.
If value input is wrong the user can reset the cell with a macro
button.

Problem:
1. First Macro works throughout the worksheet and I only want it to be
able to work in 5 groups of cells
2. Second Macro (reset macro)
The reset macro can delete the formel if this cell is chosen so I need
it to function only in the same groups as the first macro.


The code for insert av value and color

Sub mrkArbeidstid()
'
' mrkArbeidstid Makro
' Makro registrert 22.01.2008 TPS og EG
' Registrerer arbeidstid for maskin og dekksbesetningen

ActiveSheet.Protect DrawingObjects:=False, Contents:=False,
Scenarios:=False

With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
End With

Selection.Interior.ColorIndex = 35
Selection.Font.ColorIndex = 35
Selection.FormulaR1C1 = "a"

ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True

The code for reset

Sub mrkTilbakestill()
'
' mrkTilbakestill Makro
' Makro registrert 22.01.2008 TPS og EG
' Registrerer arbeidstid for maskin og dekksbesetningen

ActiveSheet.Protect DrawingObjects:=False, Contents:=False,
Scenarios:=False

With Selection.Interior

Selection.ClearContents
Selection.Interior.ColorIndex = xlNone

End With

ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True


I am just about learning this so if there's someone who has an answer
for me I would be very gratefull

Eric


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Match a group of cells with another group of cells Rod in Oz Excel Worksheet Functions 1 October 9th 08 01:45 AM
Copy Data from One Group of Cells to Another Group Alan Auerbach Charts and Charting in Excel 2 May 27th 07 04:12 PM
from a group of cells.find average of cells containing values farm Excel Discussion (Misc queries) 1 December 21st 06 08:50 PM
Macro to delete a group of CELLS Excel Discussion (Misc queries) 4 May 8th 06 04:29 PM
copy group of cells to another group of cells using "IF" in third Chuckak Excel Worksheet Functions 2 November 10th 04 06:04 PM


All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"