#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Paste special2

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?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 638
Default Paste special2

On Oct 14, 12:51 pm, Pietro wrote:
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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Paste special2

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.
--
Gary''s Student - gsnu200749


"Pietro" wrote:

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?

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
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
Paste and Paste Special command are not enabled in Excel mcalder219 Excel Worksheet Functions 0 April 26th 06 06:57 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
Paste Link enters a 0 into the cell where I paste. How do I elemin UNR Excel Discussion (Misc queries) 4 March 28th 05 01:54 AM


All times are GMT +1. The time now is 08:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"