ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   syntax qustion (https://www.excelbanter.com/excel-programming/381608-syntax-qustion.html)

x taol

syntax qustion
 
Sub Button1_Click()
Dim xVar(1 To 4, 1 To 3)
For k = 1 To 4
ax = k + 1: bx = k + 2: cx = k + 5
xVar(k) = Array(ax, bx, cx)' error
Next
[a2:c5].Value = xVar
End Sub

this code figure out error.
i want to work fast performance. and thus,
i want to run without for loop.

xVar(k,1 to 3) = Array(ax, bx, cx)
or
xVar(k,1:3) = Array(ax, bx, cx)

how can i syntax?????





*** Sent via Developersdex http://www.developersdex.com ***

Tom Ogilvy

syntax qustion
 
you can't put your values in using that method.


Sub Button1_Click()
Dim xVar(1 To 4, 1 To 3)
For k = 1 To 4
xVar(k,1) = k + 1
xVar(k,2) = k + 2
xVar(k,3) = k + 5
Next
[a2:c5].Value = xVar
End Sub

--
Regards,
Tom Ogilvy


"x taol" wrote in message
...
Sub Button1_Click()
Dim xVar(1 To 4, 1 To 3)
For k = 1 To 4
ax = k + 1: bx = k + 2: cx = k + 5
xVar(k) = Array(ax, bx, cx)' error
Next
[a2:c5].Value = xVar
End Sub

this code figure out error.
i want to work fast performance. and thus,
i want to run without for loop.

xVar(k,1 to 3) = Array(ax, bx, cx)
or
xVar(k,1:3) = Array(ax, bx, cx)

how can i syntax?????





*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 09:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com