Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hello, is it possible to create a variable within a string of text in a cell ? For example, Variable = YEAR YEAR = 2006 Data in cell = "Now, we're in YEAR." will then make Excel recognize the text, YEAR, as a variable and will appropriately insert the value there, as : "Now, we're in 2006." Is this possible to do in Excel? Thanks, Devin -- DevinC ------------------------------------------------------------------------ DevinC's Profile: http://www.excelforum.com/member.php...o&userid=22739 View this thread: http://www.excelforum.com/showthread...hreadid=505186 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Devin,
In Excel: A1: 2006 B1 ="Now, we're in " & A1 & "." In VBA: Dim sYear As String sYear = 2006 Range("A1").Value = "Now, we're in " & Year & "." --- Regards, Norman "DevinC" wrote in message ... Hello, is it possible to create a variable within a string of text in a cell ? For example, Variable = YEAR YEAR = 2006 Data in cell = "Now, we're in YEAR." will then make Excel recognize the text, YEAR, as a variable and will appropriately insert the value there, as : "Now, we're in 2006." Is this possible to do in Excel? Thanks, Devin -- DevinC ------------------------------------------------------------------------ DevinC's Profile: http://www.excelforum.com/member.php...o&userid=22739 View this thread: http://www.excelforum.com/showthread...hreadid=505186 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sounds like you need the CONCATENATE function. Cell formula should be:
=concatenate("Now we're in "&YEAR) This assumes you have named a cell "YEAR". If not, replace YEAR with your cell ref. Al "DevinC" wrote: Hello, is it possible to create a variable within a string of text in a cell ? For example, Variable = YEAR YEAR = 2006 Data in cell = "Now, we're in YEAR." will then make Excel recognize the text, YEAR, as a variable and will appropriately insert the value there, as : "Now, we're in 2006." Is this possible to do in Excel? Thanks, Devin -- DevinC ------------------------------------------------------------------------ DevinC's Profile: http://www.excelforum.com/member.php...o&userid=22739 View this thread: http://www.excelforum.com/showthread...hreadid=505186 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Devin,
Range("A1").Value = "Now, we're in " & Year & "." should read: Range("A1").Value = "Now, we're in " & sYear & "." --- Regards, Norman |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Devin,
without using a variable the following in any cell will update for whatever year it happens to be: ="Now, we're in " & YEAR(NOW()) & "." Ken Johnson |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Thanks guys! -- DevinC ------------------------------------------------------------------------ DevinC's Profile: http://www.excelforum.com/member.php...o&userid=22739 View this thread: http://www.excelforum.com/showthread...hreadid=505186 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
variable height variable width stacked bar charts | Charts and Charting in Excel | |||
Looking up a string of text within a string of text | Excel Worksheet Functions | |||
Auto convert an alphanumeric string (CIS9638S) to numbers only? | Excel Worksheet Functions | |||
Inserting Filtered RC cell information into other worksheets | Excel Discussion (Misc queries) | |||
How do I use 3 cells to create the string for a lookup function? | Excel Worksheet Functions |