type mismatch: runtime error 13 vba

rathore

New Member
Joined
Jun 30, 2010
Messages
2
Hi,
i am new to VBA
I am simply trying to add the rows in 2 colums into a rd column. i wrote

columns(3).value= columns(1).value+ columns(2).value

but it gives runtime error 13.
Any help on this.....please reply soon....gotta make this work till tomorrow!!

thanx in advance.
 

rassten

Active Member
Joined
Aug 31, 2008
Messages
310
Maybe

Code:
Sub a_test()
Lr = Cells(Rows.Count, 1).End(xlUp).Row
For i = Lr To 1 Step -1
Range("C" & i) = Range("A" & i) + Range("B" & i)
Next i
End Sub
 

rathore

New Member
Joined
Jun 30, 2010
Messages
2
thanx...but i cant use this.
yeah using loop i coud do that, but the problem is that i have 2 sets of 6 columns each of which are to be added to every other column. so if i use iteration, it take the program arnd 10 min. to calculate the result. Also i cannot use named reference as i have to use loops. So i have to use index notation.
See if u can help me with that.
 

Forum statistics

Threads
1,081,530
Messages
5,359,347
Members
400,524
Latest member
Excelbat

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top