473,466 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Runtime Error 13 type mismatch Please I need some help

1 New Member
well I dont have enough knowledgment about VB and I have some problem with one program, the program is simple I have to appear some clasfication automatically in the column b
this is a part of the program:

Sub ful()


If Columns("R") = "AR" Then
If Columns("T") = "A1" Then Columns("B").FormulaR1C1 = "Type3"
If Columns("T") = "A2" Then Columns("B").FormulaR1C1 = "Type3"
If Columns("T") = "A3" Then Columns("B").FormulaR1C1 = "Type3"

ElseIf Columns("R") = "AP" Then Columns("B").FormulaR1C1 = "Type3"

ElseIf Columns("R") = "AU" Then
If Columns("T") = "A0" Then Columns("B").FormulaR1C1 = "Type1"
If Columns("T") = "A1" Then Columns("B").FormulaR1C1 = "Type1"
If Columns("T") = "A4" Then Columns("B").FormulaR1C1 = "Type1"
If Columns("T") = "A5" Then Columns("B").FormulaR1C1 = "TypeT"
If Columns("T") = "B1" Then Columns("B").FormulaR1C1 = "Type3"
If Columns("T") = "B2" Then Columns("B").FormulaR1C1 = "Type3"
If Columns("T") = "B3" Then Columns("B").FormulaR1C1 = "Type3"
End If

End Sub
Jun 28 '07 #1
2 1947
kadghar
1,295 Recognized Expert Top Contributor
well I dont have enough knowledgment about VB and I have some problem with one program, the program is simple I have to appear some clasfication automatically in the column b
this is a part of the program:

Sub ful()


If Columns("R") = "AR" Then
If Columns("T") = "A1" Then Columns("B").FormulaR1C1 = "Type3"
If Columns("T") = "A2" Then Columns("B").FormulaR1C1 = "Type3"
If Columns("T") = "A3" Then Columns("B").FormulaR1C1 = "Type3"

ElseIf Columns("R") = "AP" Then Columns("B").FormulaR1C1 = "Type3"

ElseIf Columns("R") = "AU" Then
If Columns("T") = "A0" Then Columns("B").FormulaR1C1 = "Type1"
If Columns("T") = "A1" Then Columns("B").FormulaR1C1 = "Type1"
If Columns("T") = "A4" Then Columns("B").FormulaR1C1 = "Type1"
If Columns("T") = "A5" Then Columns("B").FormulaR1C1 = "TypeT"
If Columns("T") = "B1" Then Columns("B").FormulaR1C1 = "Type3"
If Columns("T") = "B2" Then Columns("B").FormulaR1C1 = "Type3"
If Columns("T") = "B3" Then Columns("B").FormulaR1C1 = "Type3"
End If

End Sub
May be you should try with columns("R").value = "A0" then...

anyway, you'll need that every cell in the column to be "A0" in orter to make that statement a true one.

If you want to make comparissions value by value in both columns, you should try filling the column with FormulaR1C1 and some excel formula

or try using a couple of FOR to check cell by cell.
Jun 28 '07 #2
SkinHead
39 New Member
It's Been A While Since I Did Any VB6 & I Haven't Got It Loaded On Any Of My PCs But Here Goes.

Just A Couple Of Things :

1. It Would Be Useful To Know What Type Columns Is & Where It Comes From.
2. Use A Select Case Statement Rather Than Nested Ifs

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim strType as String
  3.  
  4. strType = "Unknown"
  5.  
  6. Select Case Columns("R") 
  7. Case "AR"
  8.     strType = "Type3"
  9. Case "AU"
  10.     strType = "Type3"
  11. Case "AR"
  12.     Select Case Columns("T") 
  13.     Case "A0", "A1", "A4"
  14.         strType = "Type1"
  15.     Case "A5"
  16.         strType = "TypeT"
  17.     Case "B1", "B2", "B3"
  18.         strType = "Type3"
  19.     End Select
  20. End Select
  21.  
  22. Columns("B").FormulaR1C1 = strType
  23.  
  24.  
3. Put A Breakpoint In At The Top Of The First Select Case Statement And Step Through The Code. This Will Give You The Point Of The Error.
Jun 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mike | last post by:
I am getting a type mismatch error when I do a bulk insert. ---Begin Error Msg--- Server: Msg 4864, Level 16, State 1, Line 1 Bulk insert data conversion error (type mismatch) for row 1, column...
2
by: Lauren Wilson | last post by:
After upgrading to Access 2003 (from 2000) I now get a strange new runtime error on part of my longstanding Error handler code. This error ONLY happens when I try to run a new form with my same...
0
by: Martin Dařílek | last post by:
Hi all, I'm trying create dynamic reports by Crystal Reports engine distributed with VS.NET. I know there is only lite version without native support to do this, but I've found another way via...
9
by: Prasad | last post by:
HI, I am a beginner in VC++.. I am trying to write a Win32 console application in visual studio.. I am using following header files.. #include <STRING> using namespace std; #include...
9
by: Adrienne Boswell | last post by:
I am getting this error: Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'sid' /beta/files/index.asp There is no line number, and there is absolutely nothing on that page...
2
by: Rehan | last post by:
Hi there! Please help me out here. I am an inch away from completing my assignment. I am very new to VBA but i have very less time to be efficient at it. I am getting a type mismatch error...
3
by: Snow | last post by:
Hello: I have Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: '' The error happened at this line: if session("systemIdCount" & arrSystems(iLoop)) 0 The code like this:
1
by: monika | last post by:
Hello: I have Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: '' /OnlineLIB/BNosearch1.asp, line 32 The error happened at this line:bookno = chr(bookno) The code like...
9
by: sara | last post by:
Hi - I have code (below) that ran as recently as Monday. We decided to change the location for the output reports, and now the code errors (13 Type Mismatch) on the query. The query runs fine...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.