rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I am getting a Run-time error '13': Type mismatch flag on the code line listed below. I do not know why it is failing at this point. The data is all formatted as Number so the data format is the same. I am at a loss as to why this is failing. Any support or direction is appreciated.
The code fails on the following line and gives me the run-time error 13
This should all work fine as far as I am concerned, but I am no professional by any means. Thanks for all the help.
Robert
Code:
' Transfer Investigation tP90 data from Data History to PMI Data Transfer.
Workbooks(Home1).Activate
Sheets("PMI Data History").Select
Range("BG300000").Select
Selection.End(xlUp).Select
If ActiveCell.Row < 9 Then
If ActiveCell.Row = 2 Then
Sheets("PMI Data Transfer").Range("BN3").Value = 0 'TOTAL data
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BO3").Value = 0 'Item 1
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BP3").Value = 0 'Item 2
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BQ3").Value = 0 'Item 3
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BR3").Value = 0 'Item 4
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BS3").Value = 0 'Item 5
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BT3").Value = 0 'Item 6
ElseIf ActiveCell.Row > 2 And ActiveCell.Row < 9 Then
Sheets("PMI Data Transfer").Range("BN3").Value = 0 'TOTAL data
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BO3").Value = 0 'Item 1
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BP3").Value = 0 'Item 2
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BQ3").Value = 0 'Item 3
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BR3").Value = 0 'Item 4
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BS3").Value = 0 'Item 5
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BT3").Value = 0 'Item 6
End If
ElseIf ActiveCell.Value <> "" Then
Sheets("PMI Data Transfer").Range("BN3").Value = ActiveCell.Value - ActiveCell.Offset(-7, 0).Value 'TOTAL data
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BO3").Value = ActiveCell.Value - ActiveCell.Offset(-7, 0).Value 'Item 1
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BP3").Value = ActiveCell.Value - ActiveCell.Offset(-7, 0).Value 'Item 2
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BQ3").Value = ActiveCell.Value - ActiveCell.Offset(-7, 0).Value 'Item 3
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BR3").Value = ActiveCell.Value - ActiveCell.Offset(-7, 0).Value 'Item 4
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BS3").Value = ActiveCell.Value - ActiveCell.Offset(-7, 0).Value 'Item 5
ActiveCell.Offset(0, 1).Select
Sheets("PMI Data Transfer").Range("BT3").Value = ActiveCell.Value - ActiveCell.Offset(-7, 0).Value 'Item 6
End If
The code fails on the following line and gives me the run-time error 13
Code:
[B][COLOR=#FF0000]
[/COLOR][/B]Sheets("PMI Data Transfer").Range("BN3").Value = ActiveCell.Value - ActiveCell.Offset(-7, 0).Value 'TOTAL data[B][COLOR=#FF0000]
[/COLOR][/B]
This should all work fine as far as I am concerned, but I am no professional by any means. Thanks for all the help.
Robert