#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need code

Hi,

I have a workbook that ranks securities on a point system. I also have
a workbook that lists each security and who holds it. That workbook
has the following code which enables the user to type in the ticker and
it returns the person(s) name(s) who have it. I was hoping that I could
use a code in the first workbook that selects the worst half of the
securites and runs them through my other workbook and creates a report
of clients names and bad securites.

The code in the second workbook:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim v(1) As Variant
Dim lRow As Long

If Target.Address = "$G$4" Then
Application.EnableEvents = False
v(1) = Target.Address
'get next free column in row 5
lRow = Cells(Rows.Count, "h").End(xlUp).Row
' clear used cell row 5 to ??? column H
If lRow 5 Then
Cells(5, "h").Resize(lRow - 4).ClearContents
Else
Cells(5, "h").ClearContents
End If
' find & list all matches
Do
v(0) = Cells.Find(Target, after:=Range(v(1))).Address
If v(0) = Target.Address Or v(0) = v(1) Then
Exit Do
End If
lRow = Cells(Rows.Count, "h").End(xlUp).Row + 1
If lRow < 5 Then
lRow = 5
End If
Cells(lRow, "h").Value = Range(v(0)).Offset(, 1).Value
v(1) = v(0)
Loop
End If
Application.EnableEvents = True
End Sub

I guess I was wondering if this were possible, and then I could provide
more details if someone were willing to help. Thank you


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need code

Here is a more "wordy" explanation of what I am trying to do:
After I run the sort by decending order in my first workbook, I need t
select the worst half of ticker symbols in a column. Then, I need t
open another workbook (the one with the previous code). Then, one b
one, run each ticker symbol through my second workbook. Let me explai
more what this second workbook does: If I type a ticker symbol into
cell and hit enter -- underneath it spits out all client names tha
have it. Then, if I type in another ticker into the same cell, it wil
erase and give me new output. So, somehow I need to copy and past
inbetween inputs the ticker and the output. This would be the report.
Thank

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need code

BUMP...Last ditch effort for a repl

--
Message posted from http://www.ExcelForum.com

Reply
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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Code to conditional format all black after date specified in code? wx4usa Excel Discussion (Misc queries) 3 December 26th 08 07:06 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM
VBA code delete code but ask for password and unlock VBA protection WashoeJeff Excel Programming 0 January 27th 04 07:07 AM


All times are GMT +1. The time now is 04:16 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"