maxsea-v10.3.5
Maxsea-v10.3.5_free_mac_win_64.zip
Maxsea-v10.3.5
14,478 files here as of this posting.Q:
excel VBA - Select cells and Copy "A" cells only - Code?
I am coding in Excel VBA for a macro.
I have to copy multiple cells with values in each cell and paste it to another location in the same workbook.
Basically, it looks like this:
Input and Output:
Here is a macro I am using to copy "A" cells and paste it to another location in the same workbook.
Sub Oth()
Dim rng As Range, c As Range
Set rng = Range("A:A")
For Each c In rng.Cells
c.Copy
Range("B7").PasteSpecial xlPasteValues
Next c
End Sub
A:
Try This:
Sub Oth()
Dim rng As Range, c As Range
Set rng = Range("A:A")
For Each c In rng.Cells
c.Copy
c.Offset(0, 1).PasteSpecial xlPasteValues
Next c
End Sub
UPDATE
And If you want a button you can do it this way:
Sub Oth()
Dim rng As Range, c As Range
Set rng = Range("A:A")
Set btn = Sheet1.OthButton
Set btn.Caption = "Copy"
For Each c In rng.Cells
c.Copy
c.Offset(0, 1).PasteSpecial xlPasteValues
btn.Caption = "Copy"
Next c
End Sub
and here is the button:
Here is a link to the reference: ac619d1d87
Related links:
Comments