View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ariel Dugan Ariel Dugan is offline
external usenet poster
 
Posts: 1
Default Macro with Variable Data

Hi Jeannie,

Hope this helps...

Sheets("Daily Attendance").Activate
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To n
If Cells(i, "A").Value = "Glover, Ebony" Then

Range("A" & i & ":L" & i).copy

Exit For
End If
Next
Sheets("Ebony G").Activate

ActiveSheet.Paste Destination:=Worksheets("Ebony G").Range("A4")

End Sub


"jeannie v" wrote:

Hi: I apologize that I am a real novice in Macros.

This is the macro that works great, but I want to tweak it just a little.

Sheets("Daily Attendance").Activate
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To n
If Cells(i, "A").Value = "Glover, Ebony" Then
v = Cells(i, "C").Value
Exit For
End If
Next
Sheets("Ebony G").Activate
Range("N21").Value = v


I want to create a macro to do almost the same thing, except I want it to
retrieve more than 1 field of data for the person...Can I tweak this one to
do what I want?

I want it to say say: If "Glover, Ebony" is found by auto-filter in Column A
from Cell A2:A160 in Agent Login-Logout, Take the data in Column A through
Column L and copy to Worksheet 1 "Ebony G" in Cells A4 to L14.

Any help would be appreciated.
--
jeannie v