Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Want to use a Macro to copy and paste cell *value* only

Hello,

My simple macro is as follows:

If IsEmpty(Range("B17")) Then
Range("E2").Copy Destination:=Range("B17")
Else
Range("E2").Copy Destination:=Range("B65535").End(xlUp).Offset(1, 0)
End If

This works great except for one problem, Cell E2 is a calculation cell.
When I paste the value I get errors. What I want to paste is ONLY the value
of the cell, not the formula behind it, but I cannot figure out the syntax of
how to do that with the Copy Destination operators.

Can anyone assist? Thank You!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Want to use a Macro to copy and paste cell *value* only

Try
If IsEmpty(Range("B17")) Then
Range("B17").Value = Range("E2").Value
Else
'next is all one statement

Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Value = Range("E2").Value

'end of the single statement
End If

"HeadRusch" wrote:

Hello,

My simple macro is as follows:

If IsEmpty(Range("B17")) Then
Range("E2").Copy Destination:=Range("B17")
Else
Range("E2").Copy Destination:=Range("B65535").End(xlUp).Offset(1, 0)
End If

This works great except for one problem, Cell E2 is a calculation cell.
When I paste the value I get errors. What I want to paste is ONLY the value
of the cell, not the formula behind it, but I cannot figure out the syntax of
how to do that with the Copy Destination operators.

Can anyone assist? Thank You!

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
Copy and Paste using macro [email protected] Excel Discussion (Misc queries) 0 February 8th 07 09:47 AM
HELP with macro for copy and paste RedOctagon Excel Discussion (Misc queries) 0 October 13th 06 02:54 PM
Should I use a macro to copy and paste value? Rebecca Excel Worksheet Functions 0 April 6th 06 10:03 PM
Copy & Paste macro sparx Excel Worksheet Functions 3 September 13th 05 05:08 AM
Copy Paste macro GWB Direct Excel Discussion (Misc queries) 2 May 9th 05 03:31 PM


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

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

About Us

"It's about Microsoft Excel"