#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Macro to paste data

I have a spreadsheet that is updated each Friday and I am trying to automate
it as much as possible but have got stuck with a macro to paste one column
into another depending on the result of a formula.

I have a range C3:BB3 that represent each Friday in the year. In C4:BB4 I
have put in a formula that returns "Yes" if the date above represents the
current week or "No" otherwise. I want to paste data from B8:B10 into the
cells below the column that has "Yes" in it. E.g. If F4 = "Yes", then copy
B8:B10 into F8:F10.

The idea being that the next Friday the next column along would be updated
and the data isthen be used in a chart to review performance.

Your help would be much appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 611
Default Macro to paste data

pjd33,

Give the range B8:B10 the name "Indata" (Insert - Name - Define).

Sub CopyData()
Dim Item As Range
For Each Item In Range("C4:BB4")
If Item.Value = "Yes" Then
Range("Indata").Copy Destination:=Cells(8, Item.Column)
Exit For
End If
Next Item
End Sub
--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"pjd33" wrote in message
...
I have a spreadsheet that is updated each Friday and I am trying to
automate
it as much as possible but have got stuck with a macro to paste one column
into another depending on the result of a formula.

I have a range C3:BB3 that represent each Friday in the year. In C4:BB4 I
have put in a formula that returns "Yes" if the date above represents the
current week or "No" otherwise. I want to paste data from B8:B10 into the
cells below the column that has "Yes" in it. E.g. If F4 = "Yes", then copy
B8:B10 into F8:F10.

The idea being that the next Friday the next column along would be updated
and the data isthen be used in a chart to review performance.

Your help would be much appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Macro to paste data

Thanks for this.
It worked fine the first time but now having played about, it now copies the
formula over from the Indata range. How do I make it just paste the values? I
tried and screwed it up!

"Earl Kiosterud" wrote:

pjd33,

Give the range B8:B10 the name "Indata" (Insert - Name - Define).

Sub CopyData()
Dim Item As Range
For Each Item In Range("C4:BB4")
If Item.Value = "Yes" Then
Range("Indata").Copy Destination:=Cells(8, Item.Column)
Exit For
End If
Next Item
End Sub
--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"pjd33" wrote in message
...
I have a spreadsheet that is updated each Friday and I am trying to
automate
it as much as possible but have got stuck with a macro to paste one column
into another depending on the result of a formula.

I have a range C3:BB3 that represent each Friday in the year. In C4:BB4 I
have put in a formula that returns "Yes" if the date above represents the
current week or "No" otherwise. I want to paste data from B8:B10 into the
cells below the column that has "Yes" in it. E.g. If F4 = "Yes", then copy
B8:B10 into F8:F10.

The idea being that the next Friday the next column along would be updated
and the data isthen be used in a chart to review performance.

Your help would be much appreciated.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 611
Default Macro to paste data

OK, then let's do this:

Sub CopyData()
Dim Item As Range
For Each Item In Range("C4:BB4")
If Item.Value = "Yes" Then
Range("Indata").Copy
Cells(8, Item.Column).PasteSpecial Paste:=xlPasteValues
Exit For
End If
Next Item
End Sub
--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"pjd33" wrote in message
...
Thanks for this.
It worked fine the first time but now having played about, it now copies
the
formula over from the Indata range. How do I make it just paste the
values? I
tried and screwed it up!

"Earl Kiosterud" wrote:

pjd33,

Give the range B8:B10 the name "Indata" (Insert - Name - Define).

Sub CopyData()
Dim Item As Range
For Each Item In Range("C4:BB4")
If Item.Value = "Yes" Then
Range("Indata").Copy Destination:=Cells(8, Item.Column)
Exit For
End If
Next Item
End Sub
--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"pjd33" wrote in message
...
I have a spreadsheet that is updated each Friday and I am trying to
automate
it as much as possible but have got stuck with a macro to paste one
column
into another depending on the result of a formula.

I have a range C3:BB3 that represent each Friday in the year. In C4:BB4
I
have put in a formula that returns "Yes" if the date above represents
the
current week or "No" otherwise. I want to paste data from B8:B10 into
the
cells below the column that has "Yes" in it. E.g. If F4 = "Yes", then
copy
B8:B10 into F8:F10.

The idea being that the next Friday the next column along would be
updated
and the data isthen be used in a chart to review performance.

Your help would be much appreciated.






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Macro to paste data

Thanks very much - that does exactly what I wanted.

"Earl Kiosterud" wrote:

OK, then let's do this:

Sub CopyData()
Dim Item As Range
For Each Item In Range("C4:BB4")
If Item.Value = "Yes" Then
Range("Indata").Copy
Cells(8, Item.Column).PasteSpecial Paste:=xlPasteValues
Exit For
End If
Next Item
End Sub
--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"pjd33" wrote in message
...
Thanks for this.
It worked fine the first time but now having played about, it now copies
the
formula over from the Indata range. How do I make it just paste the
values? I
tried and screwed it up!

"Earl Kiosterud" wrote:

pjd33,

Give the range B8:B10 the name "Indata" (Insert - Name - Define).

Sub CopyData()
Dim Item As Range
For Each Item In Range("C4:BB4")
If Item.Value = "Yes" Then
Range("Indata").Copy Destination:=Cells(8, Item.Column)
Exit For
End If
Next Item
End Sub
--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"pjd33" wrote in message
...
I have a spreadsheet that is updated each Friday and I am trying to
automate
it as much as possible but have got stuck with a macro to paste one
column
into another depending on the result of a formula.

I have a range C3:BB3 that represent each Friday in the year. In C4:BB4
I
have put in a formula that returns "Yes" if the date above represents
the
current week or "No" otherwise. I want to paste data from B8:B10 into
the
cells below the column that has "Yes" in it. E.g. If F4 = "Yes", then
copy
B8:B10 into F8:F10.

The idea being that the next Friday the next column along would be
updated
and the data isthen be used in a chart to review performance.

Your help would be much appreciated.






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
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Macro to open workbook and copy and paste values in to orig workbo Dena X Excel Worksheet Functions 1 December 15th 05 11:13 PM
Macro to Synchronize data frm svrl workbooks & columns to 1 workbo jbsand1001 Excel Discussion (Misc queries) 1 April 28th 05 10:42 AM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 05:55 PM
I need a macro to find cut and paste data to new cell Rex Excel Discussion (Misc queries) 0 December 6th 04 12:23 AM


All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"