![]() |
Variable Contents Into Cell
Hi
How do you insert the contents of a variable into a cell? Thanks Michael |
Variable Contents Into Cell
"Himszy" wrote in message . uk... Hi How do you insert the contents of a variable into a cell? Thanks Michael Also, how do you save the contents of a cell to a variable |
Variable Contents Into Cell
Michael
Comment lines are preceded with ' Sub DemoVariable() 'Dimensions two variables Dim sName1 As String, sName2 As String 'Assigns one a string value sName1 = "Nick Hodge" 'Passes that string value to the 'range A1 on active sheet Range("A1").Value = sName1 'Picks up a value from A2 on active sheet 'and assigns to 2nd variable sName2 = Range("A2").Value 'Displays message box with 2nd variable value MsgBox sName2 End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Himszy" wrote in message . uk... "Himszy" wrote in message . uk... Hi How do you insert the contents of a variable into a cell? Thanks Michael Also, how do you save the contents of a cell to a variable |
Variable Contents Into Cell
"Nick Hodge" wrote in message ... Michael Comment lines are preceded with ' Sub DemoVariable() 'Dimensions two variables Dim sName1 As String, sName2 As String 'Assigns one a string value sName1 = "Nick Hodge" 'Passes that string value to the 'range A1 on active sheet Range("A1").Value = sName1 'Picks up a value from A2 on active sheet 'and assigns to 2nd variable sName2 = Range("A2").Value 'Displays message box with 2nd variable value MsgBox sName2 End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Himszy" wrote in message . uk... "Himszy" wrote in message . uk... Hi How do you insert the contents of a variable into a cell? Thanks Michael Also, how do you save the contents of a cell to a variable Thanks Nick |
All times are GMT +1. The time now is 01:10 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com