Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mark
 
Posts: n/a
Default Macro Formula revision?

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   Report Post  
Steve Smallman
 
Posts: n/a
Default

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
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
revert formula insertion to old method Don't be a pain in the ass Setting up and Configuration of Excel 0 January 24th 05 01:49 PM
Change Row Numbers in Formula with Macro Frank Excel Discussion (Misc queries) 3 January 4th 05 06:42 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM
Macro for multiple charts JS Excel Worksheet Functions 1 November 19th 04 03:44 AM


All times are GMT +1. The time now is 02:03 AM.

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"