Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro - copy values only

When I say x = Range("a1") I am copy all formatting as
well as the value in the cell. Is there a way to assign a
variable to the value in the cell only?
I want to be able to search a column and if certain
conditions are true I want to say something like
Range("X2") = x

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default macro - copy values only

if use VBA,

Dim x as Variant
x = Range("A1").Value
Range("X2").Value = x

is just the value in the cell

if you did

Dim x as Range
set x = Range("A1")

then you have created a reference to the cell and you can deal with
formatting and so forth. even in this second instance you can do

Range("X2").Value = x.Value

--
Regards,
Tom Ogilvy


"JQ" wrote in message
...
When I say x = Range("a1") I am copy all formatting as
well as the value in the cell. Is there a way to assign a
variable to the value in the cell only?
I want to be able to search a column and if certain
conditions are true I want to say something like
Range("X2") = x

Thanks



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 paste values macro Wanna Learn Excel Discussion (Misc queries) 5 July 21st 09 04:44 PM
Macro for copy and paste values excelnerd Excel Discussion (Misc queries) 3 March 8th 08 06:51 PM
Macro to copy values to Workbook KCG Excel Discussion (Misc queries) 10 November 6th 07 10:52 PM
Copy Macro values to new sheet Crowbar via OfficeKB.com New Users to Excel 0 December 20th 05 10:10 PM
Copy & Paste values macro...almost there? ste mac Excel Programming 5 November 2nd 03 10:49 PM


All times are GMT +1. The time now is 05:35 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"