Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Variable Contents Into Cell

Hi

How do you insert the contents of a variable into a cell?

Thanks Michael


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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


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
insert contents of variable cell address Charlie@ParkViewTerrace Excel Discussion (Misc queries) 1 June 30th 09 11:28 PM
Dump of all variable contents Bernie Deitrick Excel Programming 0 February 20th 04 04:18 PM
Multiple If's, one variable. And filename as cell contents steve Excel Programming 0 September 10th 03 07:36 PM
Multiple If's, one variable. And filename as cell contents hugh jass Excel Programming 0 September 10th 03 07:18 PM
Multiple If's, one variable. And filename as cell contents Dan E[_2_] Excel Programming 0 September 10th 03 07:12 PM


All times are GMT +1. The time now is 07:05 PM.

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"