Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
When writing excel formulas I use defined ranges that are named (eg "Schedule") instead of stipulating the range (eg "$AC$22:$DO$100"). How do I use defined names instead of actual ranges when writing code? I need this because the range on the excel spreadsheet keeps changing when users insert/delete rows/columns/cells and the range needs to move with the changes. Here is an example of code where the ranges would need to be replaced with the defined name... Sub Example() Sheet("Sheet2").Select Range("AC22:DO100").Select 'This is called "Schedule" Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.NumberFormat = "#,##0.00" With Selection.Font .Name = "Tahoma" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Sheet("Sheet1").Select Range("A13:DY100").Select Selection.Replace What:="0", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False -- Thank for your help BeSmart |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why use defined names? | Excel Discussion (Misc queries) | |||
defined names | Excel Worksheet Functions | |||
Defined names | Excel Worksheet Functions | |||
NAMES DEFINED | Excel Discussion (Misc queries) | |||
Defined names | Excel Discussion (Misc queries) |