#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default HELP Copy And Paste

I am trying to copy a range of cells and paste them after every Total
This is what I have so far:

Sub b8pastetitle()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste

End If
Next
End Sub
--
Stacia
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default HELP Copy And Paste

selections aren't necessary. In fact, it would be easier to use
Datafilterautofilterfilter on the column for totalcopypaste to other
sheet. Record a macro while doing and then clean up to remove the
selections. Post back with your efforts for further assistance

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I am trying to copy a range of cells and paste them after every Total
This is what I have so far:

Sub b8pastetitle()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste

End If
Next
End Sub
--
Stacia


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default HELP Copy And Paste

I guess I don't understand your reasoning. I want to copy A3:G7 after every
subtotal on same worksheet.
--
Stacia


"Don Guillett" wrote:

selections aren't necessary. In fact, it would be easier to use
Datafilterautofilterfilter on the column for totalcopypaste to other
sheet. Record a macro while doing and then clean up to remove the
selections. Post back with your efforts for further assistance

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I am trying to copy a range of cells and paste them after every Total
This is what I have so far:

Sub b8pastetitle()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste

End If
Next
End Sub
--
Stacia


.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default HELP Copy And Paste


OK. I see what you want. So I don't have to recreate
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I guess I don't understand your reasoning. I want to copy A3:G7 after
every
subtotal on same worksheet.
--
Stacia


"Don Guillett" wrote:

selections aren't necessary. In fact, it would be easier to use
Datafilterautofilterfilter on the column for totalcopypaste to other
sheet. Record a macro while doing and then clean up to remove the
selections. Post back with your efforts for further assistance

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I am trying to copy a range of cells and paste them after every Total
This is what I have so far:

Sub b8pastetitle()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste

End If
Next
End Sub
--
Stacia


.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default HELP Copy And Paste

file sent
--
Stacia


"Don Guillett" wrote:


OK. I see what you want. So I don't have to recreate
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I guess I don't understand your reasoning. I want to copy A3:G7 after
every
subtotal on same worksheet.
--
Stacia


"Don Guillett" wrote:

selections aren't necessary. In fact, it would be easier to use
Datafilterautofilterfilter on the column for totalcopypaste to other
sheet. Record a macro while doing and then clean up to remove the
selections. Post back with your efforts for further assistance

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I am trying to copy a range of cells and paste them after every Total
This is what I have so far:

Sub b8pastetitle()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste

End If
Next
End Sub
--
Stacia

.


.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default HELP Copy And Paste

Fantastic Don, don't know what I would have done without you. Thank you,
Thank you, Thank you.
--
Stacia


"Don Guillett" wrote:


OK. I see what you want. So I don't have to recreate
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I guess I don't understand your reasoning. I want to copy A3:G7 after
every
subtotal on same worksheet.
--
Stacia


"Don Guillett" wrote:

selections aren't necessary. In fact, it would be easier to use
Datafilterautofilterfilter on the column for totalcopypaste to other
sheet. Record a macro while doing and then clean up to remove the
selections. Post back with your efforts for further assistance

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I am trying to copy a range of cells and paste them after every Total
This is what I have so far:

Sub b8pastetitle()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste

End If
Next
End Sub
--
Stacia

.


.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default HELP Copy And Paste

Sub FindTotalSAS()
Call ClearHeadersSAS
Dim lr As Long
Dim c As Range
Dim firstaddress
With Worksheets(1)
lr = .Cells(Rows.Count, 1).End(xlUp).Row
With Range("a1:a" & lr)
Set c = .Find("Total", LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
If Not c Is Nothing Then
firstaddress = c.Address

Do
If Left(c.End(xlDown), 5) = "Grand" Then Exit Sub
Range("a5:g7").Copy Cells(c.Row + 1, 1)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstaddress
End If
End With
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
Fantastic Don, don't know what I would have done without you. Thank you,
Thank you, Thank you.
--
Stacia


"Don Guillett" wrote:


OK. I see what you want. So I don't have to recreate
If desired, send your file to my address below. I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I guess I don't understand your reasoning. I want to copy A3:G7 after
every
subtotal on same worksheet.
--
Stacia


"Don Guillett" wrote:

selections aren't necessary. In fact, it would be easier to use
Datafilterautofilterfilter on the column for totalcopypaste to
other
sheet. Record a macro while doing and then clean up to remove the
selections. Post back with your efforts for further assistance

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I am trying to copy a range of cells and paste them after every Total
This is what I have so far:

Sub b8pastetitle()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste

End If
Next
End Sub
--
Stacia

.


.


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default HELP Copy And Paste

I don't understand your reasoning. I am trying to copy range A3:G7 after
every subtotal on the same page.
--
Stacia


"Don Guillett" wrote:

selections aren't necessary. In fact, it would be easier to use
Datafilterautofilterfilter on the column for totalcopypaste to other
sheet. Record a macro while doing and then clean up to remove the
selections. Post back with your efforts for further assistance

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"stacia" wrote in message
...
I am trying to copy a range of cells and paste them after every Total
This is what I have so far:

Sub b8pastetitle()

Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Range("A5 : G7").Select
Selection.Copy
ActiveSheet.Paste Destination:=Worksheets("Payroll").Cells(x + 2,
1).Selection.Paste

End If
Next
End Sub
--
Stacia


.

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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy, paste without file name referenced after paste AusTexRich Excel Discussion (Misc queries) 6 September 23rd 08 02:57 AM
Copy; Paste; Paste Special are disabled Mack Neff[_3_] Excel Discussion (Misc queries) 0 April 28th 08 06:29 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM


All times are GMT +1. The time now is 04:16 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"