ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   run time error '424' when I run this code (https://www.excelbanter.com/excel-programming/336531-run-time-error-424-when-i-run-code.html)

Ravi

run time error '424' when I run this code
 
Hello:
I get run time error '424' when I run this code. Error occurs at this line
If (Error.Type(A3) = 3) Then

Could this error be fixed?

Is there any way the case of a character in a cell be checked. I want the
code use different formulas depending on the case of the character.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If (Error.Type(A3) = 3) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


Thanks

Ravi


Bob Umlas

run time error '424' when I run this code
 
Maybe
if Error.Type(Range("A3")) = 3 Then
....
Excel doesn't know what you mean by simply A3 -- it assumes it's a variable,
and it is empty.

"ravi" wrote in message
...
Hello:
I get run time error '424' when I run this code. Error occurs at this
line
If (Error.Type(A3) = 3) Then

Could this error be fixed?

Is there any way the case of a character in a cell be checked. I want the
code use different formulas depending on the case of the character.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If (Error.Type(A3) = 3) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


Thanks

Ravi




Tom Ogilvy

run time error '424' when I run this code
 
Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If Range("A3").Value = CVErr(xlErrValue) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


--
Regards,
Tom Ogilvy

"ravi" wrote in message
...
Hello:
I get run time error '424' when I run this code. Error occurs at this

line
If (Error.Type(A3) = 3) Then

Could this error be fixed?

Is there any way the case of a character in a cell be checked. I want the
code use different formulas depending on the case of the character.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If (Error.Type(A3) = 3) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


Thanks

Ravi




Ravi

run time error '424' when I run this code
 
Gives me the same error.

Ravi

"Bob Umlas" wrote:

Maybe
if Error.Type(Range("A3")) = 3 Then
....
Excel doesn't know what you mean by simply A3 -- it assumes it's a variable,
and it is empty.

"ravi" wrote in message
...
Hello:
I get run time error '424' when I run this code. Error occurs at this
line
If (Error.Type(A3) = 3) Then

Could this error be fixed?

Is there any way the case of a character in a cell be checked. I want the
code use different formulas depending on the case of the character.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If (Error.Type(A3) = 3) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


Thanks

Ravi





Ravi

run time error '424' when I run this code
 
Hello :

The code worked when Range("A1")="b" but when I change it to Range("A1")
="B",It give me a run time error ' 13' .Error occurs on the line

If Range("A3").Value = CVErr(xlErrValue) Then

Thanks.

Ravi




"Tom Ogilvy" wrote:

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If Range("A3").Value = CVErr(xlErrValue) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


--
Regards,
Tom Ogilvy

"ravi" wrote in message
...
Hello:
I get run time error '424' when I run this code. Error occurs at this

line
If (Error.Type(A3) = 3) Then

Could this error be fixed?

Is there any way the case of a character in a cell be checked. I want the
code use different formulas depending on the case of the character.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If (Error.Type(A3) = 3) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


Thanks

Ravi





Tom Ogilvy

run time error '424' when I run this code
 
Worked fine for me with both b and B in A3. xl2003. Are you using xl97.
In any event, try this revision.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"), _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
if iserror(Range("A3").Value) then
If Range("A3").Value = CVErr(xlErrValue) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
end if
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


--
Regards,
Tom Ogilvy

"ravi" wrote in message
...
Hello :

The code worked when Range("A1")="b" but when I change it to Range("A1")
="B",It give me a run time error ' 13' .Error occurs on the line

If Range("A3").Value = CVErr(xlErrValue) Then

Thanks.

Ravi




"Tom Ogilvy" wrote:

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If Range("A3").Value = CVErr(xlErrValue) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


--
Regards,
Tom Ogilvy

"ravi" wrote in message
...
Hello:
I get run time error '424' when I run this code. Error occurs at this

line
If (Error.Type(A3) = 3) Then

Could this error be fixed?

Is there any way the case of a character in a cell be checked. I want

the
code use different formulas depending on the case of the character.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If (Error.Type(A3) = 3) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


Thanks

Ravi







Ravi

run time error '424' when I run this code
 
This code works great .Thank you. I am using Excel 2003 and Excel 2000.The
initial code did not work on either of them.

Ravi


"Tom Ogilvy" wrote:

Worked fine for me with both b and B in A3. xl2003. Are you using xl97.
In any event, try this revision.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"), _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
if iserror(Range("A3").Value) then
If Range("A3").Value = CVErr(xlErrValue) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
end if
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


--
Regards,
Tom Ogilvy

"ravi" wrote in message
...
Hello :

The code worked when Range("A1")="b" but when I change it to Range("A1")
="B",It give me a run time error ' 13' .Error occurs on the line

If Range("A3").Value = CVErr(xlErrValue) Then

Thanks.

Ravi




"Tom Ogilvy" wrote:

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If Range("A3").Value = CVErr(xlErrValue) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


--
Regards,
Tom Ogilvy

"ravi" wrote in message
...
Hello:
I get run time error '424' when I run this code. Error occurs at this
line
If (Error.Type(A3) = 3) Then

Could this error be fixed?

Is there any way the case of a character in a cell be checked. I want

the
code use different formulas depending on the case of the character.

Sub Macro1()

Range("S9") = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Range("S10") = "abcdefghijklmnopqrstuvwxyz"
Range("A1") = "b"
Range("A1").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(1, 1))
If Range("C1").Value = "" Then

Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
If (Error.Type(A3) = 3) Then
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S10,1)+96) "
End If
Range("A4") = "20"
Else
Range("A3").Formula = "=DEC2HEX(FINDB(B1,S9,1)+64) "
Range("A4").Formula = "=DEC2HEX(C1)+30"
End If
End Sub


Thanks

Ravi









All times are GMT +1. The time now is 07:08 AM.

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