Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am writing a macro that will select Rows 4-10 and copy them and then past
them in row 11. I can do that but what I really would like the macro to do the next time is to select row 11-17 and copy in row 18. Is there any way that the macrro will select the 7 row with text and copy that formula to the next seven rows. This is what I did if that helps. Sub ResetWeek() ' ' ResetWeek Macro ' Macro recorded 6/12/2008 by dpitzer ' ' Sheets("Total").Select ActiveWindow.SmallScroll Down:=-12 Rows("4:10").Select Selection.Copy Range("A11").Select ActiveSheet.Paste Rows("4:10").Select Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub ResetWeek()
' ' ResetWeek Macro ' Macro recorded 6/12/2008 by dpitzer ' ' With Sheets("Total") .Rows("4:10").Copy .Range("A9").End(xlDown).Offset(1, 0) With Range(.Range("A11"), .Range("A11").End(xlDown)).EntireRow .Value = .Value End With End With End Sub -- __________________________________ HTH Bob " t.com wrote in message ... I am writing a macro that will select Rows 4-10 and copy them and then past them in row 11. I can do that but what I really would like the macro to do the next time is to select row 11-17 and copy in row 18. Is there any way that the macrro will select the 7 row with text and copy that formula to the next seven rows. This is what I did if that helps. Sub ResetWeek() ' ' ResetWeek Macro ' Macro recorded 6/12/2008 by dpitzer ' ' Sheets("Total").Select ActiveWindow.SmallScroll Down:=-12 Rows("4:10").Select Selection.Copy Range("A11").Select ActiveSheet.Paste Rows("4:10").Select Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried everyone's suggestions (Thank you) but they don't work the way I
would like them to. I don't think I'm explaining what I would like to do correctly. So here is try number two. I have rows 4-10 set up with formulas that will link to other worksheets in my excel document. I would like to be able to clear out the worksheets at the end of everyweek and re-enter the new information into it. I am trying to set up a formula that will copy my formulas that are currently in rows 4-10 and past them in the row 11 ( or the next blank row) but I need the system to recognize that the last 7 rows should be copied and then pasted in the first blank row. I know I can do this I did it before but I can't remeber how. Thanks for you help. "Don Guillett" wrote: I'm having a hard time figuring out what you want based on your description and your macro. This macro will take the cells 4-10 and and place the values starting at cell 11. Sub copyvalues() ActiveCell.Offset(6).Resize(7).Value = ActiveCell.Resize(7).Value End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software " t.com wrote in message ... I am writing a macro that will select Rows 4-10 and copy them and then past them in row 11. I can do that but what I really would like the macro to do the next time is to select row 11-17 and copy in row 18. Is there any way that the macrro will select the 7 row with text and copy that formula to the next seven rows. This is what I did if that helps. Sub ResetWeek() ' ' ResetWeek Macro ' Macro recorded 6/12/2008 by dpitzer ' ' Sheets("Total").Select ActiveWindow.SmallScroll Down:=-12 Rows("4:10").Select Selection.Copy Range("A11").Select ActiveSheet.Paste Rows("4:10").Select Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am not the most elegant macro writer, but try this code. Sub ResetWeek() A = 1 Do Until Cells(A, 1) = "" A = A + 1 Loop Range(Cells(A - 7, 1), Cells(A - 1, 255)).Copy _ Range(Cells(A, 1), Cells(A + 6, 255)) End Sub Regards - Dave. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Finally we find out what you need
Sub copyvaluestonextblankrow() mc = "A" lr = Cells(Rows.Count, mc).End(xlUp).Row + 1 Cells(lr, mc).Resize(7).Value = Cells(4, mc).Resize(7).Value End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software " t.com wrote in message ... I tried everyone's suggestions (Thank you) but they don't work the way I would like them to. I don't think I'm explaining what I would like to do correctly. So here is try number two. I have rows 4-10 set up with formulas that will link to other worksheets in my excel document. I would like to be able to clear out the worksheets at the end of everyweek and re-enter the new information into it. I am trying to set up a formula that will copy my formulas that are currently in rows 4-10 and past them in the row 11 ( or the next blank row) but I need the system to recognize that the last 7 rows should be copied and then pasted in the first blank row. I know I can do this I did it before but I can't remeber how. Thanks for you help. "Don Guillett" wrote: I'm having a hard time figuring out what you want based on your description and your macro. This macro will take the cells 4-10 and and place the values starting at cell 11. Sub copyvalues() ActiveCell.Offset(6).Resize(7).Value = ActiveCell.Resize(7).Value End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software " t.com wrote in message ... I am writing a macro that will select Rows 4-10 and copy them and then past them in row 11. I can do that but what I really would like the macro to do the next time is to select row 11-17 and copy in row 18. Is there any way that the macrro will select the 7 row with text and copy that formula to the next seven rows. This is what I did if that helps. Sub ResetWeek() ' ' ResetWeek Macro ' Macro recorded 6/12/2008 by dpitzer ' ' Sheets("Total").Select ActiveWindow.SmallScroll Down:=-12 Rows("4:10").Select Selection.Copy Range("A11").Select ActiveSheet.Paste Rows("4:10").Select Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You didn't say but change the ,3 to reflect how many columns you need from
the base column Sub copyvaluestonextblankrow() mc = "A" lr = Cells(Rows.Count, mc).End(xlUp).Row + 1 Cells(lr, mc).Resize(7, 3).Value = Cells(4, mc).Resize(7, 3).Value End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Don Guillett" wrote in message ... Finally we find out what you need Sub copyvaluestonextblankrow() mc = "A" lr = Cells(Rows.Count, mc).End(xlUp).Row + 1 Cells(lr, mc).Resize(7).Value = Cells(4, mc).Resize(7).Value End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software " t.com wrote in message ... I tried everyone's suggestions (Thank you) but they don't work the way I would like them to. I don't think I'm explaining what I would like to do correctly. So here is try number two. I have rows 4-10 set up with formulas that will link to other worksheets in my excel document. I would like to be able to clear out the worksheets at the end of everyweek and re-enter the new information into it. I am trying to set up a formula that will copy my formulas that are currently in rows 4-10 and past them in the row 11 ( or the next blank row) but I need the system to recognize that the last 7 rows should be copied and then pasted in the first blank row. I know I can do this I did it before but I can't remeber how. Thanks for you help. "Don Guillett" wrote: I'm having a hard time figuring out what you want based on your description and your macro. This macro will take the cells 4-10 and and place the values starting at cell 11. Sub copyvalues() ActiveCell.Offset(6).Resize(7).Value = ActiveCell.Resize(7).Value End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software " t.com wrote in message ... I am writing a macro that will select Rows 4-10 and copy them and then past them in row 11. I can do that but what I really would like the macro to do the next time is to select row 11-17 and copy in row 18. Is there any way that the macrro will select the 7 row with text and copy that formula to the next seven rows. This is what I did if that helps. Sub ResetWeek() ' ' ResetWeek Macro ' Macro recorded 6/12/2008 by dpitzer ' ' Sheets("Total").Select ActiveWindow.SmallScroll Down:=-12 Rows("4:10").Select Selection.Copy Range("A11").Select ActiveSheet.Paste Rows("4:10").Select Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub ResetWeek()
' ' ResetWeek Macro ' Macro recorded 6/12/2008 by dpitzer ' ' With Sheets("Total") LastRow = .Range("A" & Rows.Count).End(xlUp).Row .Rows((LastRow - 6) & ":" & LastRow).Copy _ Destination:=.Rows(LastRow + 1) End With End Sub " wrote: I am writing a macro that will select Rows 4-10 and copy them and then past them in row 11. I can do that but what I really would like the macro to do the next time is to select row 11-17 and copy in row 18. Is there any way that the macrro will select the 7 row with text and copy that formula to the next seven rows. This is what I did if that helps. Sub ResetWeek() ' ' ResetWeek Macro ' Macro recorded 6/12/2008 by dpitzer ' ' Sheets("Total").Select ActiveWindow.SmallScroll Down:=-12 Rows("4:10").Select Selection.Copy Range("A11").Select ActiveSheet.Paste Rows("4:10").Select Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Writing Macro in Excel 07 | Excel Worksheet Functions | |||
Help Writing A Macro in Excel | Excel Programming | |||
Writing macro in Excel | Excel Worksheet Functions | |||
Writing Excel Macro | Excel Worksheet Functions | |||
writing Macro in Excel | Excel Programming |