Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Naming a range with VBA...

Dim sNewname As String
sNewname = ""
Do While sNewname = ""
sNewname = InputBox("Enter initials for new person:")
If sNewname = "" Then iSvar = MsgBox("Do you want to quit?", vbYesNo)
If iSvar = vbYes Then
Exit Do
End If

Loop

Range("C2").CurrentRegion.Select

Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Activate
Loop
ActiveCell.Value = sNewname
Dim sAddr As String
sAddr = ActiveCell.Address

MsgBox sAddr
ActiveWorkbook.Names("ansvar").Delete
ActiveWorkbook.Names.Add Name:="ansvar", RefersTo:="=Lister!$c$1:"
sAddr

Range("C2").CurrentRegion.Select
Selection.Sort Key1:=Range("C2"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
_
DataOption1:=xlSortNorma

--
Message posted from http://www.ExcelForum.com

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
Naming a range hello Excel Discussion (Misc queries) 3 May 7th 07 07:01 PM
Range naming Squeaky Excel Discussion (Misc queries) 2 December 29th 06 09:10 PM
Naming a range cornishbloke[_5_] Excel Programming 1 December 15th 03 02:28 PM
Range naming BigJim Excel Programming 5 December 2nd 03 01:06 PM
Naming a Range with VB Justin Excel Programming 2 December 1st 03 09:38 PM


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