Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Writing Macro in Excel 2002

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Writing Macro in Excel 2002

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Writing Macro in Excel 2002

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Writing Macro in Excel 2002

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Writing Macro in Excel 2002

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Writing Macro in Excel 2002

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Writing Macro in Excel 2002

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
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
Writing Macro in Excel 07 Tony Excel Worksheet Functions 3 July 4th 09 02:11 AM
Help Writing A Macro in Excel [email protected] Excel Programming 2 June 12th 08 11:09 PM
Writing macro in Excel CCB AA Excel Worksheet Functions 2 January 31st 06 08:48 PM
Writing Excel Macro McHarrisco Excel Worksheet Functions 1 November 30th 05 09:28 PM
writing Macro in Excel Björn Holmgren Excel Programming 2 December 22nd 04 02:20 PM


All times are GMT +1. The time now is 09:26 AM.

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"