LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help on counting occurences

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting occurences of text DJ Excel Discussion (Misc queries) 7 September 24th 09 11:07 AM
Counting occurences of a name [email protected] Excel Worksheet Functions 3 October 8th 07 12:52 AM
Counting the occurences riomarde Excel Worksheet Functions 1 March 27th 06 09:00 PM
Counting Occurences Pete Excel Discussion (Misc queries) 7 May 2nd 05 08:28 PM
Counting Number of Occurences Darren Excel Discussion (Misc queries) 1 February 23rd 05 03:26 PM


All times are GMT +1. The time now is 04:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"