Can I simultaneously declare and assign a variable in VBA?

后端 未结 5 1809
[愿得一人]
[愿得一人] 2020-12-01 02:24

I\'m new to VBA and want to know if I can convert the following declaration and assignment into one line:

Dim clientToTest As String
clientToTest = clientsTo         


        
5条回答
  •  余生分开走
    2020-12-01 03:06

    You can define and assign value as shown below in one line. I have given an example of two variables declared and assigned in single line. if the data type of multiple variables are same

     Dim recordStart, recordEnd As Integer: recordStart = 935: recordEnd = 946
    

提交回复
热议问题