Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109098

Re: VBA - How to "execute" a dynamic variable assignment

From GS <gs@v.invalid>
Newsgroups microsoft.public.excel.programming
Subject Re: VBA - How to "execute" a dynamic variable assignment
Date 2016-07-19 00:55 -0400
Organization A noiseless patient Spider
Message-ID <nmkbsr$a2r$1@dont-email.me> (permalink)
References <dc55f9c2-b117-48f4-a0a8-952f24451f97@googlegroups.com>

Show all headers | View raw


Dim MyVar 'as variant so it can hold any 'type' of data

'Assign cell values this way...

Sub Test()
  Dim MyVar
  MyVar = [a2].Value: Debug.Print MyVar
  MyVar = [a3].Value: Debug.Print MyVar
  MyVar = Empty: Debug.Print MyVar
  MyVar = 123: Debug.Print MyVar
End Sub

..results in Immediate Window:

Purple
String

 123

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

VBA - How to "execute" a dynamic variable assignment ddmcmath@gmail.com - 2016-07-18 15:14 -0700
  Re: VBA - How to "execute" a dynamic variable assignment GS <gs@v.invalid> - 2016-07-19 00:55 -0400
  Re: VBA - How to "execute" a dynamic variable assignment "Auric__" <not.my.real@email.address> - 2016-07-19 08:20 +0000
    Re: VBA - How to "execute" a dynamic variable assignment GS <gs@v.invalid> - 2016-07-19 13:09 -0400
      Re: VBA - How to "execute" a dynamic variable assignment "Auric__" <not.my.real@email.address> - 2016-07-20 00:57 +0000
        Re: VBA - How to "execute" a dynamic variable assignment GS <gs@v.invalid> - 2016-07-20 12:29 -0400
  Re: VBA - How to "execute" a dynamic variable assignment isabelle <i@v.invalid> - 2016-07-19 21:34 -0400
    Re: VBA - How to "execute" a dynamic variable assignment isabelle <i@v.invalid> - 2016-07-19 21:47 -0400

csiph-web