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

Hi,

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"..
Is it possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Paste special

Hi Pietro.

You don't have to activate the Italian sheet to paste to it, assuming that
you want to copy one cell and paste it into the first enpty cell in Column C
then try:

Option Explicit
Sub PasteIt()
Dim cValue As Double
Dim nFormat As String
Dim Here As Long

cValue = ActiveCell.Value
nFormat = ActiveCell.NumberFormat


With Sheets("Italian")
Here = .Cells(1, 3).End(xlDown).Row + 1
.Cells(Here, 3).Value = cValue
.Cells(Here, 3).NumberFormat = nFormat
End With
End Sub


If you do really want to activate the sheet then use:

Sub PasteIt2()
Dim cValue As Double
Dim nFormat As String
Dim Here As Long

cValue = ActiveCell.Value
nFormat = ActiveCell.NumberFormat


Sheets("Italian").Activate
Here = Cells(1, 3).End(xlDown).Row + 1
Cells(Here, 3).Value = cValue
Cells(Here, 3).NumberFormat = nFormat
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Pietro" wrote in message
...
Hi,

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"..
Is it possible?



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

Thank you for your answer..
But i still did not select the cell,i need to select it and excute the below
command to paste an entire row starting from the select cell(the first empty
cell in coumn C):

Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

"Sandy Mann" wrote:

Hi Pietro.

You don't have to activate the Italian sheet to paste to it, assuming that
you want to copy one cell and paste it into the first enpty cell in Column C
then try:

Option Explicit
Sub PasteIt()
Dim cValue As Double
Dim nFormat As String
Dim Here As Long

cValue = ActiveCell.Value
nFormat = ActiveCell.NumberFormat


With Sheets("Italian")
Here = .Cells(1, 3).End(xlDown).Row + 1
.Cells(Here, 3).Value = cValue
.Cells(Here, 3).NumberFormat = nFormat
End With
End Sub


If you do really want to activate the sheet then use:

Sub PasteIt2()
Dim cValue As Double
Dim nFormat As String
Dim Here As Long

cValue = ActiveCell.Value
nFormat = ActiveCell.NumberFormat


Sheets("Italian").Activate
Here = Cells(1, 3).End(xlDown).Row + 1
Cells(Here, 3).Value = cValue
Cells(Here, 3).NumberFormat = nFormat
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Pietro" wrote in message
...
Hi,

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"..
Is it possible?




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Paste special

Hi Pietro,

But i still did not select the cell


Do you mean that it did not paste to the correct row in Column C?

If you mean to paste into the row after the last entry in Column C then use:

Option Explicit
Sub PasteIt()
Dim Here As Long
Dim There As Long

Here = ActiveCell.Row
There = Sheets("Italian").Cells(Rows.Count, 3).End(xlUp).Row + 1

Range(Cells(Here, 3), Cells(Here, 256)).Copy

Sheets("Italian").Activate
Cells(There, 3).Select

Selection.PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Selection.PasteSpecial Paste:=xlFormats, _
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Application.CutCopyMode = False
End Sub

This will copy everything in the active sheet in the row in which the cursor
is located except columns A&B and paste it into the "Italian" sheet in the
Row under the last entry in Column C.

But as I said It is not necessary to actually activate the "Italian" sheet
to paste to it:

Option Explicit
Sub PasteIt2()
Dim Here As Long
Dim There As Long

Here = ActiveCell.Row
There = Sheets("Italian").Cells(Rows.Count, 3).End(xlUp).Row + 1

Range(Cells(Here, 3), Cells(Here, 256)).Copy

Sheets("Italian").Cells(There, 3).PasteSpecial _
Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Sheets("Italian").Cells(There, 3).PasteSpecial _
Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Application.CutCopyMode = False
End Sub

If I still don't understand what it is you want then do post back with a
more detailed explanation of your requirements.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Pietro" wrote in message
...
Thank you for your answer..
But i still did not select the cell,i need to select it and excute the
below
command to paste an entire row starting from the select cell(the first
empty
cell in coumn C):

Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

"Sandy Mann" wrote:

Hi Pietro.

You don't have to activate the Italian sheet to paste to it, assuming
that
you want to copy one cell and paste it into the first enpty cell in
Column C
then try:

Option Explicit
Sub PasteIt()
Dim cValue As Double
Dim nFormat As String
Dim Here As Long

cValue = ActiveCell.Value
nFormat = ActiveCell.NumberFormat


With Sheets("Italian")
Here = .Cells(1, 3).End(xlDown).Row + 1
.Cells(Here, 3).Value = cValue
.Cells(Here, 3).NumberFormat = nFormat
End With
End Sub


If you do really want to activate the sheet then use:

Sub PasteIt2()
Dim cValue As Double
Dim nFormat As String
Dim Here As Long

cValue = ActiveCell.Value
nFormat = ActiveCell.NumberFormat


Sheets("Italian").Activate
Here = Cells(1, 3).End(xlDown).Row + 1
Cells(Here, 3).Value = cValue
Cells(Here, 3).NumberFormat = nFormat
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Pietro" wrote in message
...
Hi,

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"..
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
'paste special', 'paste link' formatting transfer jrebello Excel Discussion (Misc queries) 2 July 25th 07 08:46 AM
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. tln Links and Linking in Excel 0 April 22nd 07 04:28 PM
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


All times are GMT +1. The time now is 12:07 AM.

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"