Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default CAN I MODIFY DATA ENTERED INTO A CELL

I have an Excel spreadsheet that works as a service report. Several of the
cells represent costs(i.e. Hotel, Rental Car, etc.). I have installed a
checkbox that can be checked if a customer meets certain criteria. If
checked, it adds and then discounts a range of cells by 10%. Easy enough. I
have had some requests by customers to reflect the discount on a per cell
basis, so if service rep enters:
Hotel $100.00
when the checkbox is checked the same cell changes to reflect the discount:
Hotel $ 90.00
The IF statement is simple enough, but the formula gets overwritten the
minute the user enters the amount of the expense, so.....
Can I modify the data entered without creating a circular reference?, or..
Can I attach a formula to a cell that cannot be overwritten by user input?
( basically, a hidden formula)

Thanks to all,
Tim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default CAN I MODIFY DATA ENTERED INTO A CELL

Do you want it to hold 100 and show 90 or do you want it to hold 90. If the
answer is to hold 90 here is some code that will apply a discount to cells C2
through C10 based on if the check box is checked or not.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cbxMyCheckBox As Shape
Dim rngToAdjust As Range

On Error GoTo ErrorHandler
Set rngToAdjust = Range("C2:C10")
If Not Intersect(Target, rngToAdjust) Is Nothing Then
Set cbxMyCheckBox = Sheet1.Shapes("Check Box 1")
If cbxMyCheckBox.ControlFormat.Value = 1 And IsNumeric(Target.Value)
Then
Application.EnableEvents = False
Target.Value = Target.Value - (Target.Value * 0.1)
End If
End If
ErrorHandler:
Application.EnableEvents = True
End Sub

Jim Thomlinson


"Tim Richards" wrote:

I have an Excel spreadsheet that works as a service report. Several of the
cells represent costs(i.e. Hotel, Rental Car, etc.). I have installed a
checkbox that can be checked if a customer meets certain criteria. If
checked, it adds and then discounts a range of cells by 10%. Easy enough. I
have had some requests by customers to reflect the discount on a per cell
basis, so if service rep enters:
Hotel $100.00
when the checkbox is checked the same cell changes to reflect the discount:
Hotel $ 90.00
The IF statement is simple enough, but the formula gets overwritten the
minute the user enters the amount of the expense, so.....
Can I modify the data entered without creating a circular reference?, or..
Can I attach a formula to a cell that cannot be overwritten by user input?
( basically, a hidden formula)

Thanks to all,
Tim

Reply
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
Change color of cell when different cell has data entered B J G Excel Discussion (Misc queries) 1 October 18th 07 07:59 PM
data changes when entered into a cell Ian Gill Excel Worksheet Functions 1 October 10th 06 05:39 PM
Modify Row & Cell based on Multiple Data Brett Patterson Excel Worksheet Functions 0 November 5th 04 07:11 PM
Stop to modify the SQL query manually entered into query ! Olivier Rollet Excel Programming 6 November 3rd 04 08:34 AM
Which data have been entered into a cell ? hglamy[_2_] Excel Programming 3 October 14th 03 07:46 PM


All times are GMT +1. The time now is 01:21 PM.

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

About Us

"It's about Microsoft Excel"