PC Review


Reply
Thread Tools Rate Thread

Copying data from one sheet to another on a specific date

 
 
=?Utf-8?B?R2F2MTIz?=
Guest
Posts: n/a
 
      2nd May 2007
Hi,
I posted this in the worksheet functions forum but no response...so I
thought that I would try here..

I want to be able to automatically copy data from one sheet to another sheet
on the last day of the month (the sheets are in the same workbook) when the
user opens or saves it (either way would be fine)

On sheet 1 there is a running total say cell C3 and on sheet 2 the
destination cells Jan, Feb, March etc.

Is there a way to have my running total populate the correct months figures
while keeping the previous months total. Just now the user manually inputs
the figures but if I can automate this task it would save time for the user.

I hope that I have explained the problem clearly enough.....

Any help you can provide would be appreciated.

Gav.

 
Reply With Quote
 
 
 
 
Carl Hartness
Guest
Posts: n/a
 
      3rd May 2007
Use the year as the column index and month as the row index to the
cell on Sheet2, something like:
Sub SaveMonthlySubtotal()
Dim yr As Integer, mon As Integer
mon = Month(Now)
yr = Year(Now) - 2005
Sheets("Sheet1").Range("A3").Copy _
Destination:=Sheets("Sheet2").Cells(mon, yr)
End Sub
Adjust the mon and yr variables to get the value into the cell you
want.

HTH
Carl

On May 2, 3:21 am, Gav123 <Gav...@discussions.microsoft.com> wrote:
> Hi,
> I posted this in the worksheet functions forum but no response...so I
> thought that I would try here..
>
> I want to be able to automatically copy data from one sheet to another sheet
> on the last day of the month (the sheets are in the same workbook) when the
> user opens or saves it (either way would be fine)
>
> On sheet 1 there is a running total say cell C3 and on sheet 2 the
> destination cells Jan, Feb, March etc.
>
> Is there a way to have my running total populate the correct months figures
> while keeping the previous months total. Just now the user manually inputs
> the figures but if I can automate this task it would save time for the user.
>
> I hope that I have explained the problem clearly enough.....
>
> Any help you can provide would be appreciated.
>
> Gav.


 
Reply With Quote
 
=?Utf-8?B?R2F2MTIz?=
Guest
Posts: n/a
 
      4th May 2007
Hi Carl,

Thanks for your response... The macro is almost working perfectly, there is
one slight problem I need it to keep the integrity of the previous month data
for example..

Say April was 20% and May is 30% when the data is transferred to sheet
called "Monthly Graph" it updates both April and May to 30% and I need April
to remain as 20%

Sub SaveMonthlySubtotal()
Dim yr As Integer, mon As Integer
mon = Month(Now)
yr = Year(Now) - 2005
Sheets("Overall").Range("D5").Copy _
Destination:=Sheets("Monthly Graph").Cells(mon, yr)
End Sub

Is it possible to have the months update but keep the previous months totals?

Your help is appreciated..

Gav.

"Carl Hartness" wrote:

> Use the year as the column index and month as the row index to the
> cell on Sheet2, something like:
> Sub SaveMonthlySubtotal()
> Dim yr As Integer, mon As Integer
> mon = Month(Now)
> yr = Year(Now) - 2005
> Sheets("Sheet1").Range("A3").Copy _
> Destination:=Sheets("Sheet2").Cells(mon, yr)
> End Sub
> Adjust the mon and yr variables to get the value into the cell you
> want.
>
> HTH
> Carl
>
> On May 2, 3:21 am, Gav123 <Gav...@discussions.microsoft.com> wrote:
> > Hi,
> > I posted this in the worksheet functions forum but no response...so I
> > thought that I would try here..
> >
> > I want to be able to automatically copy data from one sheet to another sheet
> > on the last day of the month (the sheets are in the same workbook) when the
> > user opens or saves it (either way would be fine)
> >
> > On sheet 1 there is a running total say cell C3 and on sheet 2 the
> > destination cells Jan, Feb, March etc.
> >
> > Is there a way to have my running total populate the correct months figures
> > while keeping the previous months total. Just now the user manually inputs
> > the figures but if I can automate this task it would save time for the user.
> >
> > I hope that I have explained the problem clearly enough.....
> >
> > Any help you can provide would be appreciated.
> >
> > Gav.

>
>

 
Reply With Quote
 
cbhartness@aol.com
Guest
Posts: n/a
 
      5th May 2007
I set up a new workbook with two sheets and your cells and macro, and
it works perfectly. You must have something else going on. Take
another look. Maybe a formula or merged cells? Want me to take a
look at it?

Carl.

On May 4, 4:41 am, Gav123 <Gav...@discussions.microsoft.com> wrote:
> Hi Carl,
>
> Thanks for your response... The macro is almost working perfectly, there is
> one slight problem I need it to keep the integrity of the previous month data
> for example..
>
> Say April was 20% and May is 30% when the data is transferred to sheet
> called "Monthly Graph" it updates both April and May to 30% and I need April
> to remain as 20%
>
> Sub SaveMonthlySubtotal()
> Dim yr As Integer, mon As Integer
> mon = Month(Now)
> yr = Year(Now) - 2005
> Sheets("Overall").Range("D5").Copy _
> Destination:=Sheets("Monthly Graph").Cells(mon, yr)
> End Sub
>
> Is it possible to have the months update but keep the previous months totals?
>
> Your help is appreciated..
>
> Gav.
>
>
>
> "Carl Hartness" wrote:
> > Use the year as the column index and month as the row index to the
> > cell on Sheet2, something like:
> > Sub SaveMonthlySubtotal()
> > Dim yr As Integer, mon As Integer
> > mon = Month(Now)
> > yr = Year(Now) - 2005
> > Sheets("Sheet1").Range("A3").Copy _
> > Destination:=Sheets("Sheet2").Cells(mon, yr)
> > End Sub
> > Adjust the mon and yr variables to get the value into the cell you
> > want.

>
> > HTH
> > Carl

>
> > On May 2, 3:21 am, Gav123 <Gav...@discussions.microsoft.com> wrote:
> > > Hi,
> > > I posted this in the worksheet functions forum but no response...so I
> > > thought that I would try here..

>
> > > I want to be able to automatically copy data from one sheet to another sheet
> > > on the last day of the month (the sheets are in the same workbook) when the
> > > user opens or saves it (either way would be fine)

>
> > > On sheet 1 there is a running total say cell C3 and on sheet 2 the
> > > destination cells Jan, Feb, March etc.

>
> > > Is there a way to have my running total populate the correct months figures
> > > while keeping the previous months total. Just now the user manually inputs
> > > the figures but if I can automate this task it would save time for the user.

>
> > > I hope that I have explained the problem clearly enough.....

>
> > > Any help you can provide would be appreciated.

>
> > > Gav.- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying specific data from Sheet 1 to Sheet 2 Jock Microsoft Excel Programming 1 28th Oct 2008 05:56 PM
Copying Data from one sheet to another sheet on a specific day =?Utf-8?B?R2F2MTIz?= Microsoft Excel Worksheet Functions 0 1st May 2007 10:17 AM
Copying Specific Values From Sheet =?Utf-8?B?SmVubg==?= Microsoft Excel Misc 1 11th Jul 2005 09:22 PM
Copying Data to a Specific Row Based on Date PFH Microsoft Excel New Users 2 11th Aug 2004 11:32 PM
Copying specific rows from one sheet to another Chris Microsoft Excel Programming 1 16th Oct 2003 09:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:52 AM.