Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hallo,
I have made the next macro, but when I want to run it I get an error message: "Run-time error 13: Type mimatch". Can anybody please tell me what I'm doing wrong. Sub Abs_Bkg() Dim rng As Range Dim lRownum As Long Dim i As Long Dim j As Long Dim exSh As Worksheet Dim wks As Worksheet Set exSh = Worksheets("raw data from spad it") Set wks = Worksheets("Calculated Data") With exSh.UsedRange lRownum = .Cells(.Rows.Count, 1).Row End With With wks For j = 1 To 4 Set rng = Range("O2:O" & lRownum) For i = 2 To lRownum wks.Cells(i, rng.Offset(V, j)).Value = exSh.Cells(i, rng.Offset(O, j)).Value - _ wks.Cells(rng.Offset("AL4", j)).Value Next i j = j + 1 Next End With End Sub What this macro has to do is to substract AL4 (worksheet "wks") from O2 (worksheet "exSh") and put the solution in V2 ("wks"). And then go to the next row but keep "AL4" absolute. Do the same calculation till the lastrow. Then go to the next column, now is AL4 variable. So; P2 - AM4 = W2. When going to the next row AM4 stays AM4. Thanks, -Metin- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Type mismatch" when I try to fill an Array variable with "+" | Excel Discussion (Misc queries) | |||
multiple file uploading - runtime error'13': type mismatch "While Counter <= UBound(FName)" | Excel Discussion (Misc queries) | |||
"FIND" generates "Type mismatch" error | Excel Programming | |||
Type mismatch: .Cells(i).Value = "=rc[-1]" / vl | Excel Programming | |||
Copying data to another worksheet gives "Type Mismatch" error | Excel Programming |