Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Merjet,
I wrote a code to club the same stocks together. this will check the stock name in row 2 with row3 and look for a match and cut and paste the result in the row added after the first occurence,however while executing the code I get a Runtime 1004 error any ideas to remove that. regards Krishna sub macro() Dim i As Integer Dim j As Integer i = 2 Do While Not IsEmpty(Worksheets("sheet1").Range("B" & i)) j = 3 Do While Not IsEmpty(Worksheets("sheet1").Range("B" & j)) If (Worksheets("sheet1").Range("B" & i)) = Worksheets("sheet1").Range("B" & j) Then Worksheets("sheet1").Range("B" & j).Cut Worksheets("sheet1").Range("B" & i + 1).Insert shift:=xlDown End If j = j + 1 Loop i = i + 1 Loop end sub "merjet" wrote in message ... Will sorting the data (on stock_name) with the menu Data | Sort get what you want? HTH, Merjet |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting occurences of text | Excel Discussion (Misc queries) | |||
Counting occurences of a name | Excel Worksheet Functions | |||
Counting the occurences | Excel Worksheet Functions | |||
Counting Occurences | Excel Discussion (Misc queries) | |||
Counting Number of Occurences | Excel Discussion (Misc queries) |