Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Forum,
How do I change the Macro so when I run the macro again to update values I added to my source sheet I will get the correct update. Everyday I add to the daily cash worksheet a new deposit. After I recorded my macro to the last day of the month. Great. But when I added data to the cash worksheet did not appear in check register. So I updated the macro and did not work properly. Also is it possible for macros to be inserted within the proper Date column. Check register has 5 checks written for 11/1 then, 11/2 has 4 checks. Can the macro place the cash deposit within these dates according? Destination is Check Register Source sheet is Daily Cash Totals Example Below: Sub mcrgetdeposits() ' ' mcrgetdeposits Macro ' Macro recorded 11/23/2004 by Mark ' ' Windows("Test1CashDeposit.xls").Activate ActiveWindow.WindowState = xlNormal ActiveWindow.WindowState = xlNormal Range("A3").Select Selection.AutoFill Destination:=Range("A3:A32"), Type:=xlFillDefault Range("A3:A32").Select Selection.Copy Windows("Test1CheckReg.xls").Activate ActiveWindow.WindowState = xlNormal ActiveWindow.WindowState = xlNormal ActiveSheet.Paste Windows("Test1CashDeposit.xls").Activate ActiveWindow.WindowState = xlNormal ActiveWindow.WindowState = xlNormal Range("F3:F32").Select Application.CutCopyMode = False Selection.Copy Windows("Test1CheckReg.xls").Activate ActiveWindow.WindowState = xlNormal ActiveWindow.WindowState = xlNormal Range("D70").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False ActiveWindow.SmallScroll Down:=20 End Sub Thank you, Mark, |
#2
![]() |
|||
|
|||
![]()
Mark,
Your problem is that you recorded the macro and highlighted a limited range of cells. Quick answer to your query is expand the ranges to include the maximum possible number of cells. I assume that what you are doing with this code is using autofill to generate dates in the cash deposit sheet copying these to the check register sheet, and then copying whatever is in the cells in the F column of your cash deposits and pasting to cell D70 in check register. Is that what you intended? I think what you need to do is re-record your macro to make it do what you wanted, when/if you strike a problem repost to the programming group. Before you do, I suggest that you have a think through your logic. A quick look a the code generated seems to show that you were unsure of what you were attempting to achieve. Rule one of macros is think first. Define the problem and the methodology you are going to use to solve it. I know that sounds rather negative, but it seems you are learning the way most of us have, identifying a task, and building a solution to achieve that task. Keep going! it really is worth it and it does get easier. Steve "Mark" wrote in message ... Forum, How do I change the Macro so when I run the macro again to update values I added to my source sheet I will get the correct update. Everyday I add to the daily cash worksheet a new deposit. After I recorded my macro to the last day of the month. Great. But when I added data to the cash worksheet did not appear in check register. So I updated the macro and did not work properly. Also is it possible for macros to be inserted within the proper Date column. Check register has 5 checks written for 11/1 then, 11/2 has 4 checks. Can the macro place the cash deposit within these dates according? Destination is Check Register Source sheet is Daily Cash Totals Example Below: Sub mcrgetdeposits() ' ' mcrgetdeposits Macro ' Macro recorded 11/23/2004 by Mark ' ' Windows("Test1CashDeposit.xls").Activate ActiveWindow.WindowState = xlNormal ActiveWindow.WindowState = xlNormal Range("A3").Select Selection.AutoFill Destination:=Range("A3:A32"), Type:=xlFillDefault Range("A3:A32").Select Selection.Copy Windows("Test1CheckReg.xls").Activate ActiveWindow.WindowState = xlNormal ActiveWindow.WindowState = xlNormal ActiveSheet.Paste Windows("Test1CashDeposit.xls").Activate ActiveWindow.WindowState = xlNormal ActiveWindow.WindowState = xlNormal Range("F3:F32").Select Application.CutCopyMode = False Selection.Copy Windows("Test1CheckReg.xls").Activate ActiveWindow.WindowState = xlNormal ActiveWindow.WindowState = xlNormal Range("D70").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False ActiveWindow.SmallScroll Down:=20 End Sub Thank you, Mark, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
revert formula insertion to old method | Setting up and Configuration of Excel | |||
Change Row Numbers in Formula with Macro | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
Cell doesn't show formula result - it shows formula (CTRL + ' doe. | Excel Worksheet Functions | |||
Macro for multiple charts | Excel Worksheet Functions |