View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
jeannie v jeannie v is offline
external usenet poster
 
Posts: 127
Default Create a Macro with a List

Hi Bob:

This is the Macro I used a couple of years ago....honestly, one of you,
experts, gave this to me and it was much more advanced than I was able to
build....Is there someway we could make it work for the example I documented
below.....I got so lost when I tried to adapt this to what I wanted. This is
more than what I need, I think...Can you help?

Sub Summary


Dim n As Integer, i As Integer, j As Integer, k As Integer, m As Integer
Dim rng As Range, dest As Range
Dim wss As Worksheet, wsd As Worksheet, wsl As Worksheet
Dim mName As String, mSheet As String
Set wsl = ThisWorkbook.Sheets("List")
Set wss = ThisWorkbook.Sheets("Summary")

wsl.Activate
k = wsl.Cells(Rows.Count, "A").End(xlUp).Row
If k = 0 Then Exit Sub
For m = 1 To k
mName = wsl.Cells(m, 1).Value: mSheet = wsl.Cells(m, 2).Value
Set wsd = ThisWorkbook.Sheets(mSheet)
n = wss.Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To n
j = WorksheetFunction.CountA(Range("A3:A17")) + 4
wsd.Activate
Set dest = wsd.Range("A" & j & ":L" & j)
If wss.Cells(i, "A").Value = mName Then
wss.Range("A" & i & ":L" & i).Copy
dest.Select
Selection.PasteSpecial Paste:=xlPasteValues
End If

Next i
--
jeannie v


"Bob Bridges" wrote:

Why, Jeannie, fancy meeting you here! :-) It sounds to me as though you
already have an idea of how the program should work and something about it
isn't doing what you think it should. Can you post some code and the error
message, or whatever behavior you get that isn't what you want? I could say
"just have your code look through the original report page and pull up the
rows that have the name (or whatever) that you want, and then..." But
doubtless you're already doing that, or trying.

--- "jeannie v" wrote:
Hi Bob:

Thank you for the prompt response....I just inherited this report and it is
HUGE...the report is filled with VLOOKUPs and I know I can make it more
efficient with Macros..I"m taking the report is pieces...of which this is the
first of many pieces to this report. It's not the same data every month or
the same individuals (all would be in the List, though), so I was hoping that
I could build a Macro that would pull and pop the correct data no matter who
or what was identified for the month, each month.

I had a Macro that I used a couple of years ago that did something similar,
but I can't make it work for this report...there are differences that just
don't work.


--- "jeannie v" wrote:
I would like to build a macro with the List for multiple individuals that
will then enter the data from the List to the Summary Worksheet in the same
Workbook. This is the example of what I want to do....

List Sheet

John Jones in Column A....123456 in Column B...ABCDF in Column C and 90.05%
in Column D

Put that data on the Summary Worksheet in Columns B, C, D & E

I would also like to remove the % sign in Column D

Can anyone help me with this? I would appreciate any assistance you can
provide. I'm working on a new reporting document that is using VLOOKUPs....a
lot of them every month....I think the Macro would be more efficient, but I
need your help to build on.