LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro copying cells between sheets


I have the following macro assigned to a button ("New Grass Week") in
the "Grass Cutting" sheet. It is suppose to, upon clicking, take data
from the "Customers" sheet and paste it into the proper columns in the
"Grass Cutting" sheet. It doesnt do anything when clicked and I get no
errors. I just think there something missing.

Any ideas?


URL of the .xls sheet
http://www.ashleylandscaping.com/excel-example.xls


Code:
--------------------
Sub NewGrassWeek()


Dim FilterRange As Range, CopyRange As Range
Dim c As Range, r As Range, x As Range


Set wsHistory = Sheets("Grass Cutting")
Set wsDaily = Sheets("Customers")
Set r = wsDaily.Range("I3:I6666")
Set c = wsHistory.Range("A3:A6666")
Set x = wsDaily.Range("A3:A6666")

For Each r In x

If r.Value = "y" Then

Range("A" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!A:A)"
Range("B" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!B:B)"
Range("C" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!C:C)"
Range("D" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!D:D)"
Range("E" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!E:E)"
Range("F" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!F:F)"
Range("G" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!G:G)"
Range("H" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!H:H)"
Range("L" & c.Row).Formula = "=LOOKUP(A" & c.Row & ",Customers!A:A,Customers!J:J)"

Application.ScreenUpdating = True

End If

Next r

End Sub
--------------------


--
cbrd
------------------------------------------------------------------------
cbrd's Profile: http://www.excelforum.com/member.php...o&userid=30009
View this thread: http://www.excelforum.com/showthread...hreadid=498221

 
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
Copying cells between sheets in a workbook Rick Excel Discussion (Misc queries) 2 November 21st 08 01:55 PM
NEED a MAJOR help with SHEETS copying MACRO bioyyy Excel Discussion (Misc queries) 4 October 29th 08 04:26 AM
Copying sheets in a macro jhyatt Excel Discussion (Misc queries) 0 October 3rd 07 07:17 PM
Copying Macro w/ different sheets liseladele Excel Worksheet Functions 1 March 22nd 06 01:43 AM
copying the same cells from many sheets t.o. Excel Worksheet Functions 3 February 16th 06 10:35 PM


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