Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Designated a cell as a name range


Can I designate the cell that I am is a "named range"?
For exmample:

Range("A1").Select
Cells.Find(What:="Involuntary Termination Count"
MatchCase:=True).Select
Selection.ClearContents
Selection.Offset(1, 0).Select

How do I program VBA to name the active cell I am in?

(I need to program this way as Involuntary Termination Count keep
moving depending on the pivot table report generated.

Thanks

--
Fastbik
-----------------------------------------------------------------------
Fastbike's Profile: http://www.excelforum.com/member.php...fo&userid=2670
View this thread: http://www.excelforum.com/showthread.php?threadid=40031

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Designated a cell as a name range

Without actually selecting any cells:

Dim InvTC As Range
Dim myRange As Range
With Cells
Set InvTC = .Find(What:="Involuntary Termination Count" _
, MatchCase:=True)
End With
If Not InvTC Is Nothing Then 'checks that Involuntary Ter... was found
InvTC.ClearContents
Set myRange = InvTC.Offset(1, 0)
ActiveWorkbook.Names.Add Name:="myNamedRange", _
RefersTo:="=" & ActiveSheet.Name & "!" & myRange.Address
End If

Hope this helps
Rowan

"Fastbike" wrote:


Can I designate the cell that I am is a "named range"?
For exmample:

Range("A1").Select
Cells.Find(What:="Involuntary Termination Count",
MatchCase:=True).Select
Selection.ClearContents
Selection.Offset(1, 0).Select

How do I program VBA to name the active cell I am in?

(I need to program this way as Involuntary Termination Count keeps
moving depending on the pivot table report generated.

Thanks.


--
Fastbike
------------------------------------------------------------------------
Fastbike's Profile: http://www.excelforum.com/member.php...o&userid=26701
View this thread: http://www.excelforum.com/showthread...hreadid=400318


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Designated a cell as a name range


Great, I will try that out.

Thanks for the hel

--
Fastbik
-----------------------------------------------------------------------
Fastbike's Profile: http://www.excelforum.com/member.php...fo&userid=2670
View this thread: http://www.excelforum.com/showthread.php?threadid=40031

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
Looking up a value next to a designated cell g.king Excel Discussion (Misc queries) 3 June 13th 09 04:24 PM
No printing of b/w designated cell patterns WIN Excel Discussion (Misc queries) 1 June 10th 08 01:15 AM
Excel, function, result to be returned in another designated cell EXCEL WORKSHEET FUNCTIONS Excel Worksheet Functions 3 July 21st 06 06:24 PM
Text that includes data from a designated cell? Blades Excel Discussion (Misc queries) 2 June 27th 06 01:07 PM
Creating 'yes' or 'no' option in a designated cell ian123[_29_] Excel Programming 2 December 28th 03 03:32 PM


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