close

My sheets are named 1,2,3....100
at any time i may be located at any sheet.
I wish to copy selected values to the same position from sheet quot;mquot; to the
next quot;nquot; sheets where n is not going to run past 100. The from and to
positions are concrete and the same. If you want colour they are mens
wedding suit items and party name.Maybe you want this (there is no error check in this example if you are in sheet 100)

Sub CopySelection()
Dim myarea As Range
For Each myarea In Selection.Areas
With myarea
.Copy Destination:=.Parent.Next.Range(.Address)
End With
Next myarea
End Sub--
Regards Ron de Bruin
www.rondebruin.nlquot;Douglas groomquot; lt;Douglas gt; wrote in message
...
gt; My sheets are named 1,2,3....100
gt; at any time i may be located at any sheet.
gt; I wish to copy selected values to the same position from sheet quot;mquot; to the
gt; next quot;nquot; sheets where n is not going to run past 100. The from and to
gt; positions are concrete and the same. If you want colour they are mens
gt; wedding suit items and party name.
gt;
This is just an example going from Sheet1 to Sheet2. The copied cells don't
have to be connected. Select any combination you choose. You can change it
to go from any sheet to any other sheet:Sub Macro10()
Dim sx As String
Dim r1 As Range
Dim r As Range
Sheets(quot;Sheet1quot;).Select
s1 = quot;Sheet1!A1:A10,C1:C10quot;
Set r1 = Range(s1)
For Each r In r1
sx = quot;Sheet2!quot; amp; r.Address
r.Copy Range(sx)
Next
End Sub
--
Gary''s Studentquot;Douglas groomquot; wrote:

gt; My sheets are named 1,2,3....100
gt; at any time i may be located at any sheet.
gt; I wish to copy selected values to the same position from sheet quot;mquot; to the
gt; next quot;nquot; sheets where n is not going to run past 100. The from and to
gt; positions are concrete and the same. If you want colour they are mens
gt; wedding suit items and party name.
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()