ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro is not able to identify the value. (https://www.excelbanter.com/excel-programming/424092-macro-not-able-identify-value.html)

Heera[_2_]

Macro is not able to identify the value.
 

Hi All,

I have created the below mentioned loop which return me TRUE or FALSE Value
in a cell.
Do Until ActiveCell.Offset(0, -11).Value = ""
ActiveCell.FormulaR1C1 = "=ISERROR(VLOOKUP(RC[-12],'[" & Dname & "]Data
Base'!R2C1:R20000C1,1,0))"
ActiveCell.Offset(1, 0).Select
Loop

After that I have below mentioned code but the macro is not able to detect
the cell value as true or false.(In If function) I am not able to understand
what is going wrong with the coding.

Do Until ActiveCell.Value = ""
If ActiveCell.Value = "TRUE" Then
'Here I have my code.
End if
Loop
Heera

joel

Macro is not able to identify the value.
 
Use TEXT instead of value. You also looping on the same cell which will
produce an endless loop.

Do Until ActiveCell.Value = ""
If ActiveCell.Text = "TRUE" Then
'Here I have my code.
End if
Loop


"Heera" wrote:


Hi All,

I have created the below mentioned loop which return me TRUE or FALSE Value
in a cell.
Do Until ActiveCell.Offset(0, -11).Value = ""
ActiveCell.FormulaR1C1 = "=ISERROR(VLOOKUP(RC[-12],'[" & Dname & "]Data
Base'!R2C1:R20000C1,1,0))"
ActiveCell.Offset(1, 0).Select
Loop

After that I have below mentioned code but the macro is not able to detect
the cell value as true or false.(In If function) I am not able to understand
what is going wrong with the coding.

Do Until ActiveCell.Value = ""
If ActiveCell.Value = "TRUE" Then
'Here I have my code.
End if
Loop
Heera


Rick Rothstein

Macro is not able to identify the value.
 
"TRUE" with quote marks is a string of characters that just *looks* like
TRUE, but it is not the value TRUE. Just remove the quote marks in your
test...

If ActiveCell.Value = True Then

--
Rick (MVP - Excel)


"Heera" wrote in message
...

Hi All,

I have created the below mentioned loop which return me TRUE or FALSE
Value
in a cell.
Do Until ActiveCell.Offset(0, -11).Value = ""
ActiveCell.FormulaR1C1 = "=ISERROR(VLOOKUP(RC[-12],'[" & Dname & "]Data
Base'!R2C1:R20000C1,1,0))"
ActiveCell.Offset(1, 0).Select
Loop

After that I have below mentioned code but the macro is not able to detect
the cell value as true or false.(In If function) I am not able to
understand
what is going wrong with the coding.

Do Until ActiveCell.Value = ""
If ActiveCell.Value = "TRUE" Then
'Here I have my code.
End if
Loop
Heera



Heera[_2_]

Macro is not able to identify the value.
 
Thank you Rick and Joel

Both of your's codes worked fine.

Regards
Heera


All times are GMT +1. The time now is 10:00 PM.

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