Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Evaluate vba matric

change -
.Names.Add Name:="ArrTemp", RefersToR1C1:="={A,B,C,D,E,F,G,H,I,J}"


to -
.Names.Add Name:="ArrTemp", RefersToR1C1:=Array(A, B, C, D, E, F, G, H, I,
J)
or
dim vArr as variant
varr = Array(A, B, C, D, E, F, G, H, I, J)
.....refersto:=vArr

Regards,
Peter T

"PST" wrote in message
...
Hello

Why the second macro does not work, the first yes , it there t it a
resolution so that it takes into account letters. purpose it is to apply
a matrix to a picture without crire on the disc.

purpose it is to apply a matrix to an array without writing on the disc.

1)Work

Sub test_mat_array()
With ActiveWorkbook
.Names.Add Name:="ArrTemp",

RefersToR1C1:="={1,2,3,4,5,6,7,8,9,10}"
.ActiveSheet.Cells(1, 1).Value =
Evaluate("=SUMPRODUCT(--(ArrTemp=1),--(ArrTemp<=5))")
.Names("ArrTemp").Delete
End With
End Sub


2) does not work

With ActiveWorkbook

A = 1
B = 2
C = 3
d = 4
E = 5
F = 6
G = 7
H = 8
I = 9
j = 10

.Names.Add Name:="ArrTemp", RefersToR1C1:="={A,B,C,D,E,F,G,H,I,J}"
.ActiveSheet.Cells(1, 1).Value =
Evaluate("=SUMPRODUCT(--(ArrTemp=1),--(ArrTemp<=6))")
.Names("ArrTemp").Delete
End With

thank you



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default Evaluate vba matric

Remember... TRUE in vba is Backwards. :0

Sub Demo()
A = 1: B = 2: C = 3: d = 4: E = 5
F = 6: G = 7: H = 8: I = 9: J = 10

v = Array(A, B, C, d, E, F, G, H, I, J)
[A1] = [SumProduct(-(v=1), -(v<=5))]
End Sub

--
HTH :)
Dana DeLouis
Windows XP & Excel 2007


"PST" wrote in message
...
Hello

Why the second macro does not work, the first yes , it there t it a
resolution so that it takes into account letters. purpose it is to apply a
matrix to a picture without crire on the disc.

purpose it is to apply a matrix to an array without writing on the disc.

1)Work

Sub test_mat_array()
With ActiveWorkbook
.Names.Add Name:="ArrTemp",
RefersToR1C1:="={1,2,3,4,5,6,7,8,9,10}"
.ActiveSheet.Cells(1, 1).Value =
Evaluate("=SUMPRODUCT(--(ArrTemp=1),--(ArrTemp<=5))")
.Names("ArrTemp").Delete
End With
End Sub


2) does not work

With ActiveWorkbook

A = 1
B = 2
C = 3
d = 4
E = 5
F = 6
G = 7
H = 8
I = 9
j = 10

.Names.Add Name:="ArrTemp", RefersToR1C1:="={A,B,C,D,E,F,G,H,I,J}"
.ActiveSheet.Cells(1, 1).Value =
Evaluate("=SUMPRODUCT(--(ArrTemp=1),--(ArrTemp<=6))")
.Names("ArrTemp").Delete
End With

thank you



  #3   Report Post  
Posted to microsoft.public.excel.programming
PST PST is offline
external usenet poster
 
Posts: 29
Default Evaluate vba matric

Hello

Why the second macro does not work, the first yes , it there t it a
resolution so that it takes into account letters. purpose it is to apply
a matrix to a picture without crire on the disc.

purpose it is to apply a matrix to an array without writing on the disc.

1)Work

Sub test_mat_array()
With ActiveWorkbook
.Names.Add Name:="ArrTemp", RefersToR1C1:="={1,2,3,4,5,6,7,8,9,10}"
.ActiveSheet.Cells(1, 1).Value =
Evaluate("=SUMPRODUCT(--(ArrTemp=1),--(ArrTemp<=5))")
.Names("ArrTemp").Delete
End With
End Sub


2) does not work

With ActiveWorkbook

A = 1
B = 2
C = 3
d = 4
E = 5
F = 6
G = 7
H = 8
I = 9
j = 10

..Names.Add Name:="ArrTemp", RefersToR1C1:="={A,B,C,D,E,F,G,H,I,J}"
..ActiveSheet.Cells(1, 1).Value =
Evaluate("=SUMPRODUCT(--(ArrTemp=1),--(ArrTemp<=6))")
..Names("ArrTemp").Delete
End With

thank you
  #4   Report Post  
Posted to microsoft.public.excel.programming
PST PST is offline
external usenet poster
 
Posts: 29
Default Evaluate vba matric

thank you


1) Gives me a message error *NOM?

Sub Demo()
A = 1: B = 2: C = 3: d = 4: E = 5
F = 6: G = 7: H = 8: I = 9: J = 10

v = Array(A, B, C, d, E, F, G, H, I, J)
[A1] = [SumProduct(-(v=1), -(v<=5))]
End Sub


2) work but is very slow, is it normal

.Names.Add Name:="ArrTemp", RefersToR1C1:=Array(A, B, C, D, E, F, G, H, I,
J)


Dana DeLouis a écrit :
Remember... TRUE in vba is Backwards. :0

Sub Demo()
A = 1: B = 2: C = 3: d = 4: E = 5
F = 6: G = 7: H = 8: I = 9: J = 10

v = Array(A, B, C, d, E, F, G, H, I, J)
[A1] = [SumProduct(-(v=1), -(v<=5))]
End Sub


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
evaluate afdmello Excel Worksheet Functions 3 May 16th 10 09:11 PM
Matric vba array Alan Beban Excel Programming 2 August 24th 07 04:02 AM
enumeration by vba or by matric or both PST Excel Programming 0 June 3rd 07 12:05 PM
Why Evaluate? Dave Unger Excel Programming 13 March 5th 07 04:58 PM
Evaluate formula using VBA Ali Baba Excel Discussion (Misc queries) 0 August 17th 05 12:31 AM


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