Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Macro to open workbook and copy and paste values in to orig workbo | Excel Worksheet Functions | |||
Macro to Synchronize data frm svrl workbooks & columns to 1 workbo | Excel Discussion (Misc queries) | |||
Pulling data from 1 sheet to another | Excel Worksheet Functions | |||
I need a macro to find cut and paste data to new cell | Excel Discussion (Misc queries) |