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: 337
Default Expanding a range

I have the following code

Private Sub CommandButton1_Click() 'Extend range and sort project numbers

Application.ScreenUpdating = False 'Keeps screen from updating thereby
speeding
Application.DisplayAlerts = False 'code execution

Dim Project_Numbers As Range

Application.GoTo Reference:="Project_Numbers" 'Check to see if the first
record is blank
Range("A11").Select
If Range("A12") = "" Then
Range("A12").Select
End
Else

Set rng = Range("Project_Numbers")
rng.Resize(rng.Rows.Count + 1).Name = "Project_Numbers"
Selection.Sort Key1:=Range("A11"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Application.GoTo Reference:="Employee_Initials"

MainMenu.Show
End If
End Sub

This works fine if I am only adding one project at a time. but some times I
might add 2 or more projects

thanks in advance

oldjay
 
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
Expanding Range in Formula? John Sofillas Excel Discussion (Misc queries) 4 August 6th 09 01:26 PM
Expanding a named range jayceejay Excel Worksheet Functions 3 November 11th 08 01:52 AM
Expanding a Range Automatically Rob E Excel Discussion (Misc queries) 6 January 25th 08 05:57 AM
expanding a range of numbers chchch Excel Discussion (Misc queries) 1 February 28th 06 07:51 PM
Expanding Selection Range Jim May[_4_] Excel Programming 5 August 30th 04 07:01 PM


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

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"