Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying cells between sheets in a workbook | Excel Discussion (Misc queries) | |||
NEED a MAJOR help with SHEETS copying MACRO | Excel Discussion (Misc queries) | |||
Copying sheets in a macro | Excel Discussion (Misc queries) | |||
Copying Macro w/ different sheets | Excel Worksheet Functions | |||
copying the same cells from many sheets | Excel Worksheet Functions |