PC Review


Reply
Thread Tools Rate Thread

copy cell to next open line

 
 
=?Utf-8?B?cHN3YW5pZQ==?=
Guest
Posts: n/a
 
      29th Jun 2007
on sheet1 cell c15 i got ppl entering the day sales. and alot of other info.

all the other info gets cleared with a macro. mike h gave me a
threat that will "copy and paste" sheet1 cell c15 upon the enter being hit.
problem are that if the wrong sales input have been done the wrong amount
will be "carried" over. and when they go back to enter the correct data that
will then be added to the next open line on sheet2.

sheet2 looks like this and the day's sales will then be carried over to
colum d
______________________________________________________
a b c d
______________________________________________________
1 \ sales projection
2 \ date day last yr sales this yr sales
3 \ 01/07/07 mon $1.20 ****
4 \ 02/07/07 tues $1.20 ****
5 \ 03/07/07 wed $1.20 ****
6 \ 04/07/07 thur $1.20 ****
7 \ 05/07/07 frid $1.20 ****


what i think i need are some thing like this...




select sheet1 range c15
copy
select sheet2
if system date 01/07/07 then select.d3 or if system date 02/07/07 then
select.d4 or if system date 03/07/07 then select.d5 etc
paste

'and then rest of my current macro

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      29th Jun 2007
Hi,

This collects the value from C15 (Sheet 1) looks for todays date in Column B
od shhet 2 and when it finds it puts the data in column D. Will that do?

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myrange As Range
If Intersect(Target, Range("c15")) _
Is Nothing Then Exit Sub
newdata = Target.Value
lastrowcolb = Worksheets("Sheet2").Range("B65536").End(xlUp).Row
For x = 1 To lastrowcolb
If Sheets("Sheet2").Cells(x, 2).Value = Date Then
Sheets("Sheet2").Cells(x, 2).Offset(0, 2).Value = newdata
End If
Next
End Sub

Mike
"pswanie" wrote:

> on sheet1 cell c15 i got ppl entering the day sales. and alot of other info.
>
> all the other info gets cleared with a macro. mike h gave me a
> threat that will "copy and paste" sheet1 cell c15 upon the enter being hit.
> problem are that if the wrong sales input have been done the wrong amount
> will be "carried" over. and when they go back to enter the correct data that
> will then be added to the next open line on sheet2.
>
> sheet2 looks like this and the day's sales will then be carried over to
> colum d
> ______________________________________________________
> a b c d
> ______________________________________________________
> 1 \ sales projection
> 2 \ date day last yr sales this yr sales
> 3 \ 01/07/07 mon $1.20 ****
> 4 \ 02/07/07 tues $1.20 ****
> 5 \ 03/07/07 wed $1.20 ****
> 6 \ 04/07/07 thur $1.20 ****
> 7 \ 05/07/07 frid $1.20 ****
>
>
> what i think i need are some thing like this...
>
>
>
>
> select sheet1 range c15
> copy
> select sheet2
> if system date 01/07/07 then select.d3 or if system date 02/07/07 then
> select.d4 or if system date 03/07/07 then select.d5 etc
> paste
>
> 'and then rest of my current macro
>

 
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
Copy Cell From Subtotal Line To Detail Line Tickfarmer Microsoft Excel Misc 2 5th Nov 2009 02:40 PM
copy first line in a cell Nev Microsoft Excel Misc 10 24th May 2009 05:14 PM
copy first line in a cell Nev Microsoft Excel Misc 0 23rd May 2009 01:26 PM
how to copy a whole line according to one cell in the line to a di kbee Microsoft Excel Worksheet Functions 2 15th Feb 2008 08:12 AM
Can you copy an Excel cell without the automatic line break? chillynois@yahoo.com Microsoft Excel Discussion 5 29th Jul 2005 11:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:17 AM.