Macro Help

pujo

Well-known Member
Joined
Feb 19, 2009
Messages
710
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Hey Gang,
I am trying to figure this out. I haven't had any luck, maybe someone could shed a little light on the subject.
Here is the delima.....

I have 8 counters in cell A1:A8, A9 is the sum of A1:A8. These are daily totals.

In cell I1:I31 is the days of the month, with cell I32 the sum of I1:I31

How could I use a macro to move the value of A9 to the the column that I use for the day of the month.

An on change macro would work to move the vlaue to the next empty cell on colomn "I" but it doesnt work correctly. everytime I change one of the 8 counters, it gets copied to the next empty cell in column "I". I would like for it to only get copied once all 8 cells are updated.
I hope someone can understand what I am asking, as I really don't know how to explain any other way.
Thanks,
Pujo
 
This will find the first blank cell after I15 (it won't stop at I20 though)

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A8" Then
    Application.EnableEvents = False
    Target.Offset(1).Copy
    Range("I15").End(xlDown).Offset(1).PasteSpecial Paste:=xlPasteValues
    Application.EnableEvents = True
    Application.CutCopyMode = False
End If
End Sub
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I tried and this is the result.
Thanks for the assistance.

HTML:
Run-time error '1004':
Application-defined or ogject-defined error.
 
Upvote 0
Maybe

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A8" Then
    Application.EnableEvents = False
    Target.Offset(1).Copy
    Range("I1").End(xlDown).Offset(1).PasteSpecial Paste:=xlPasteValues
    Application.EnableEvents = True
    Application.CutCopyMode = False
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top