VBA Macro question

blickmjon

New Member
Joined
Jan 25, 2010
Messages
2
Hey All,

I have a spreadsheet here that I need help with. You can download it here (the file name is Prices.xls): http://www.sendspace.com/file/mysnw2

I have a macro that is affecting each "Day." (i.e. Day1, Day2, Day3, etc.) Here is what it's doing:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 8 Then Exit Sub
On Error Resume Next
Select Case Target.Row
Case 6, 7, 21, 40, 44, 45, 48 '<<<< change cell to suit needs
Application.EnableEvents = False
Target.Value = Target.Value * 0.99
Case Else: Exit Sub
End Select
Application.EnableEvents = True
On Error GoTo 0
End Sub

It's taking 1% off of each determined row (6, 7, 21, 40, 44, 45, 48) except for the Ethanol cell (Target.Column = 8). Well, what I'm trying to figure out is how to make one of the Ethanol cells actually take off 1%. If you look at the spreadsheet... I want to have cell H21 to take off the 1%. That's the only one I want it to take place.

Any suggestions? Thanks in advance.

Blickmjon
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Welcome to the board!

I didn't download your spreadsheet - not sure how many people here will. But does this minor change do what you want?

Rich (BB code):
If Target.Column = 8 and target.row<>21 Then Exit Sub

Tai
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,661
Members
449,114
Latest member
aides

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top