Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Visual Basic Code

I have this code in my spreadsheet. But I don't want it to include all
the rows that are above row number 10 (I just want it to include row 10
and all the rows that are
below it). How can I do it?

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$G$10" Then _
Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1)
If Target.Address = "$I$2" Then _
Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1)
Application.EnableEvents = True

If Target.Row < 2 Then Exit Sub
Application.EnableEvents = False
If Target.Column = 7 Then _
Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1)
If Target.Column = 9 Then _
Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1)
Application.EnableEvents = True
End Sub

Thanks.

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
Visual Basic code Pickle Excel Discussion (Misc queries) 1 September 4th 08 03:35 PM
I need a visual basic code....please Rhonda Excel Discussion (Misc queries) 1 March 5th 07 01:18 PM
Visual Basic Code amirstal Excel Programming 1 December 8th 06 04:40 PM
Visual basic Code GRobertson Excel Programming 3 January 10th 05 02:16 PM
visual basic code Whitey Excel Programming 1 October 26th 04 04:05 PM


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

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"