LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 127
Default MACRO IS NOT WORKING AS IT SHOULD

Hi:

This Macro is almost working, but there is a slight glitsch......When the
person's data from Worksheet 2 to Worksheet 1 start paste in Range A4, only
the first line of data pastes to A4...the rest of the person's data pastes
down below in lines 42 down.....Any help would be greatly
appreciated..........

Sub LoginLogout()
'
'
Dim n As Integer, i As Integer
Dim rng As Range

Sheets("Agent Login-Logout").Activate
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To n
Sheets("Agent Login-Logout").Activate
If Cells(i, "A").Value = "Miller, Chris" Then
Range("A" & i & ":L" & i).Copy
Sheets("Christopher M").Activate
If Range("A4") = "" Then
Set rng = Worksheets("Christopher M").Range("A4")
rng.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Else
Sheets("Christopher M").Activate
n = Cells(Rows.Count, "A").End(xlUp).Row + 1
Set rng = Worksheets("Christopher M").Range("A" & n)
rng.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End If
End If
Next i

End Sub
--
jeannie v
 
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
macro not working dpolston Excel Discussion (Misc queries) 2 April 19th 07 09:16 PM
Macro not working at year end Paul S Excel Discussion (Misc queries) 2 January 20th 07 11:27 PM
macro not working Jonathan Cooper Excel Discussion (Misc queries) 1 February 1st 06 10:06 PM
Insert Row macro not working Acct Supr - DCTC Excel Discussion (Misc queries) 3 October 7th 05 01:11 AM
"Compare2Lists" Macro Not working B Schwarz Excel Discussion (Misc queries) 3 January 7th 05 11:35 PM


All times are GMT +1. The time now is 09:58 PM.

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

About Us

"It's about Microsoft Excel"