ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rookie question: placing a value into one cell based on a forrmula in another (https://www.excelbanter.com/excel-programming/281239-rookie-question-placing-value-into-one-cell-based-forrmula-another.html)

Kelley[_2_]

Rookie question: placing a value into one cell based on a forrmula in another
 
How do I use Excel VBA to place the calculated value of one cell into
another cell as a fixed value. i.e.: A1 contains the formula
=today()-6 which today resolves as "10/27/03" or it's serial
equivalent. I would like a macro to put "10/27/03" into B1 as a value.

I know this is easy, but I can't find an answer anywhere. For future
reference, is there an free online resource for people just learning
VBA?

Thanks,

Kelley New

Chip Pearson

Rookie question: placing a value into one cell based on a forrmula in another
 
Kelley,

I'm not sure exactly what you're after, but perhaps you are looking for
something like

Range("B1").Value = Range("A1").Value

This will put the value of A1 in to B1.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Kelley" wrote in message
om...
How do I use Excel VBA to place the calculated value of one cell into
another cell as a fixed value. i.e.: A1 contains the formula
=today()-6 which today resolves as "10/27/03" or it's serial
equivalent. I would like a macro to put "10/27/03" into B1 as a value.

I know this is easy, but I can't find an answer anywhere. For future
reference, is there an free online resource for people just learning
VBA?

Thanks,

Kelley New




Tom Ogilvy

Rookie question: placing a value into one cell based on a forrmula in another
 
Range("B1").Value = ''" Range("A1").Text

if you want it in as a string

Range("B1").Value = Range("A1").Value
Range("B1").Numberformat = Range("A1").Numberformat

There is no charge for posting here.

Dave McRitchie has a links to some tutorials. The VBA tutorials are after
the Excel tutorials:
http://www.mvps.org/dmcritchie/excel....htm#tutorials

--
Regards,
Tom Ogilvy

Kelley wrote in message
om...
How do I use Excel VBA to place the calculated value of one cell into
another cell as a fixed value. i.e.: A1 contains the formula
=today()-6 which today resolves as "10/27/03" or it's serial
equivalent. I would like a macro to put "10/27/03" into B1 as a value.

I know this is easy, but I can't find an answer anywhere. For future
reference, is there an free online resource for people just learning
VBA?

Thanks,

Kelley New





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com