ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with MATCH function (https://www.excelbanter.com/excel-programming/357334-problem-match-function.html)

Maileen[_3_]

Problem with MATCH function
 
Hi,

i try to use match to search some value. When i run it, excel displays an
error 13 : type mismatch.

Here is my code:

Set rngCrit1 = ThisWorkbook.Sheets("Backup").Range("G1:G65536")
Set rngCrit2 = ThisWorkbook.Sheets("Backup").Range("H1:H65536")
Set rngCrit3 = ThisWorkbook.Sheets("Backup").Range("K1:K65536")

Dim varTest As Variant
varTest = WorksheetFunction.Match(ThisWorkbook.Sheets("Progr ams").Range("G"
& iCounter).Value & ThisWorkbook.Sheets("Programs").Range("H" &
iCounter).Value & ThisWorkbook.Sheets("Programs").Range("K" &
iCounter).Value, rngCrit1 & rngCrit2 & rngCrit3, 0)

i do not understand where is the problem.
please, could you help me ?
thx,
Maileen

Toppers

Problem with MATCH function
 
You are trying to match a concatenation of three cells with 3 ranges
(Columns); match works on one column only.

Can you explain what you are trying to do in your code. If your search
values are 1,2 and 3 I ssume you looking for 1 in column G, 2 in H and 3 in K?

"Maileen" wrote:

Hi,

i try to use match to search some value. When i run it, excel displays an
error 13 : type mismatch.

Here is my code:

Set rngCrit1 = ThisWorkbook.Sheets("Backup").Range("G1:G65536")
Set rngCrit2 = ThisWorkbook.Sheets("Backup").Range("H1:H65536")
Set rngCrit3 = ThisWorkbook.Sheets("Backup").Range("K1:K65536")

Dim varTest As Variant
varTest = WorksheetFunction.Match(ThisWorkbook.Sheets("Progr ams").Range("G"
& iCounter).Value & ThisWorkbook.Sheets("Programs").Range("H" &
iCounter).Value & ThisWorkbook.Sheets("Programs").Range("K" &
iCounter).Value, rngCrit1 & rngCrit2 & rngCrit3, 0)

i do not understand where is the problem.
please, could you help me ?
thx,
Maileen



All times are GMT +1. The time now is 11:39 AM.

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