Paste special2

G

Guest

I need a code to activate a tab named "Italian",then to SELECT the first
empty row in column C ,then to paste special "Values and numbers
format",this command should paste an entire row starting from the selected
cell (the first empty cell in column C)
Is it possible?
 
J

JW

I need a code to activate a tab named "Italian",then to SELECT the first
empty row in column C ,then to paste special "Values and numbers
format",this command should paste an entire row starting from the selected
cell (the first empty cell in column C)
Is it possible?

I am assuming that you will already have something stored to your
clipboard. Otherwise, you won't be pasting anything.
Really need more detail, but this code will take what is on the
clipboard and paste it's values and formats into the first available
row in column C and all the way over to column IV (because you said
the whole row). Like I said, a more detailed answer could be given if
more detail can be provided.

Sub pasteValuesFormats()
Dim r As Long
With Sheets("Italian")
r = .Cells(.Rows.Count, "C") _
.End(xlUp).Offset(1, 0).Row
.Range(Cells(r, "C"), Cells(r, "IV")).PasteSpecial _
Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
End With
End Sub
 
G

Guest

Hi Pietro:

Dim i As Long
Sheets("Italian").Activate
For i = 1 To Rows.Count
If Cells(i, "C").Value = "" Then
Exit For
End If
Next
Cells(i, "C").PasteSpecial Paste:=xlPasteValues
Cells(i, "C").PasteSpecial Paste:=xlPasteFormats

The quantity of cells that are pasted depends upon the Copy:

Sub pietro()
Dim i As Long
Sheets("Italian").Activate
Range("A26:H26").Copy
For i = 1 To Rows.Count
If Cells(i, "C").Value = "" Then
Exit For
End If
Next
Cells(i, "C").PasteSpecial Paste:=xlPasteValues
Cells(i, "C").PasteSpecial Paste:=xlPasteFormats
End Sub


will copy 8 cells.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top