Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Cell Assignment


Group,
After I select a cell how do I assign the contents of the cel
into a variable? Seems trivial, but it has me stuck.

Learning VBA and loving it........

Ton

--
ajociu
-----------------------------------------------------------------------
ajocius's Profile: http://www.excelforum.com/member.php...fo&userid=1769
View this thread: http://www.excelforum.com/showthread.php?threadid=39056

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default VBA - Cell Assignment

myVar = Activecell

but no need to select it

myVar = Range("A1").Value

--
HTH

Bob Phillips

"ajocius" wrote in
message ...

Group,
After I select a cell how do I assign the contents of the cell
into a variable? Seems trivial, but it has me stuck.

Learning VBA and loving it........

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile:

http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=390560



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default VBA - Cell Assignment

somethink like this should work, not sure what you have in the cell, though

Dim MyText As String

Sub Mytest()
MyText = Range("b2").Value
MsgBox MyText
End Sub

--


Gary


"ajocius" wrote in
message ...

Group,
After I select a cell how do I assign the contents of the cell
into a variable? Seems trivial, but it has me stuck.

Learning VBA and loving it........

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile:
http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=390560



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Cell Assignment


var1 = activecell

where var1 is the variable nam

--
barrfl

Excel User - Energy market
-----------------------------------------------------------------------
barrfly's Profile: http://www.excelforum.com/member.php...nfo&userid=414
View this thread: http://www.excelforum.com/showthread.php?threadid=39056

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
Number Assignment GRK Excel Worksheet Functions 3 April 26th 08 12:31 AM
Dynamic Assignment of a Cell Address In Formula tb Excel Worksheet Functions 9 December 14th 07 06:52 AM
point assignment Blah Excel Discussion (Misc queries) 4 July 21st 06 12:29 AM
Key Assignment Log Norma Excel Discussion (Misc queries) 0 May 12th 05 04:10 PM
assignment problem L. Chung Excel Worksheet Functions 1 April 17th 05 06:06 AM


All times are GMT +1. The time now is 11:51 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"