LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Multiple If Statements or Macro's in Worksheet:View Code

Hello,

I am trying to sort two different areas in one worksheet. I am trying to
use the following code but it only works for the first area not the second.

Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Range("h3:n500"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("h3:n500").Sort Key1:=Range("h3")
Application.EnableEvents = True
If Intersect(Range("p3:t500"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("p3:t500").Sort Key1:=Range("p3")
Application.EnableEvents = True

End Sub
 
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
Macros - copying macros from one computer to another TT Excel Discussion (Misc queries) 18 December 14th 06 03:24 AM
copy and use vba code Giz Excel Discussion (Misc queries) 9 November 22nd 06 09:57 PM
macro or code to open multiple workbooks Duane Reynolds Excel Discussion (Misc queries) 1 March 14th 06 08:18 AM
How to: Multiple "if" statements? Hosh New Users to Excel 2 June 29th 05 02:20 PM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM


All times are GMT +1. The time now is 10:38 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"