Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to name a sheet from the result of a formula that gets is
result from a cell in a worksheet, the following is my routine but first writes the formula to cell A1 in the worksheet, is there a more appropriate method? Dim shname As String Range("A1").Formula = _ "=""DD""&Left(Right(A2, 10), 2) & Right(B2, 6)" shname = Range("A1").Value Range("A1").ClearContents Sheets(1).Name = shname Thanks, Rob |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't think you need a formula as there are VBA Left and Right methods. So
how about Sheets(1).Name = "DD" & Left(Right(A2, 10), 2) & Right(B2, 6) -- HTH Bob Phillips "Rob" wrote in message ... I would like to name a sheet from the result of a formula that gets is result from a cell in a worksheet, the following is my routine but first writes the formula to cell A1 in the worksheet, is there a more appropriate method? Dim shname As String Range("A1").Formula = _ "=""DD""&Left(Right(A2, 10), 2) & Right(B2, 6)" shname = Range("A1").Value Range("A1").ClearContents Sheets(1).Name = shname Thanks, Rob |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
Thanks for this, I amended to include Range so as I had set Options Explicit Sheets(1).Name = "DD" & Left(Right(Range("A2"), 10), 2) & Right(Range("B2"), 6) "Bob Phillips" wrote in message ... I don't think you need a formula as there are VBA Left and Right methods. So how about Sheets(1).Name = "DD" & Left(Right(A2, 10), 2) & Right(B2, 6) -- HTH Bob Phillips "Rob" wrote in message ... I would like to name a sheet from the result of a formula that gets is result from a cell in a worksheet, the following is my routine but first writes the formula to cell A1 in the worksheet, is there a more appropriate method? Dim shname As String Range("A1").Formula = _ "=""DD""&Left(Right(A2, 10), 2) & Right(B2, 6)" shname = Range("A1").Value Range("A1").ClearContents Sheets(1).Name = shname Thanks, Rob |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
of course ... should have spotted that :-)
Bob "Rob" wrote in message ... Bob, Thanks for this, I amended to include Range so as I had set Options Explicit Sheets(1).Name = "DD" & Left(Right(Range("A2"), 10), 2) & Right(Range("B2"), 6) "Bob Phillips" wrote in message ... I don't think you need a formula as there are VBA Left and Right methods. So how about Sheets(1).Name = "DD" & Left(Right(A2, 10), 2) & Right(B2, 6) -- HTH Bob Phillips "Rob" wrote in message ... I would like to name a sheet from the result of a formula that gets is result from a cell in a worksheet, the following is my routine but first writes the formula to cell A1 in the worksheet, is there a more appropriate method? Dim shname As String Range("A1").Formula = _ "=""DD""&Left(Right(A2, 10), 2) & Right(B2, 6)" shname = Range("A1").Value Range("A1").ClearContents Sheets(1).Name = shname Thanks, Rob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Show formula result in another sheet | Excel Worksheet Functions | |||
Naming the Result Cells on a Scenario Summary | Excel Discussion (Misc queries) | |||
Can I annotate a formula result in Sheet 1 in Sheet 2 by Cell Addr | Excel Worksheet Functions | |||
Sheet naming | Excel Programming | |||
Naming a new sheet. | Excel Programming |