#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cell Value

Hi there,

i am a newbie in excel vba and i made a simple macro but i miss something
there.

it is a macro that selects value of cell "A1" and then paste it in cell "B1"
quite simple ?, but my PROBLEM is that: the cell value "A1" isn't numbers
(it is something like 3+2*2) so when i paste it in "B1" i get the same
result of "A1" while i want to evalute "A1" , so any ideas. THANX.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Cell Value

Hi Dodo,

Try:

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

---
Regards,
Norman


"dodo" wrote in message
...
Hi there,

i am a newbie in excel vba and i made a simple macro but i miss something
there.

it is a macro that selects value of cell "A1" and then paste it in cell
"B1" quite simple ?, but my PROBLEM is that: the cell value "A1" isn't
numbers (it is something like 3+2*2) so when i paste it in "B1" i get the
same result of "A1" while i want to evalute "A1" , so any ideas. THANX.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cell Value

hi there,

sorry, i still have the same error, which is that the cell "B1" did not
evalute the cell value "A1" (e.g. 2+3*2) .

all i want is to add "=" before the contents of "A1" then evalute in "B1"

thanx

"Norman Jones" wrote in message
...
Hi Dodo,

Try:

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

---
Regards,
Norman


"dodo" wrote in message
...
Hi there,

i am a newbie in excel vba and i made a simple macro but i miss something
there.

it is a macro that selects value of cell "A1" and then paste it in cell
"B1" quite simple ?, but my PROBLEM is that: the cell value "A1" isn't
numbers (it is something like 3+2*2) so when i paste it in "B1" i get the
same result of "A1" while i want to evalute "A1" , so any ideas. THANX.







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Cell Value

Hi Dodo,

Try:

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



---
Regards,
Norman



"dodo" wrote in message
...
hi there,

sorry, i still have the same error, which is that the cell "B1" did not
evalute the cell value "A1" (e.g. 2+3*2) .

all i want is to add "=" before the contents of "A1" then evalute in "B1"

thanx

"Norman Jones" wrote in message
...
Hi Dodo,

Try:

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

---
Regards,
Norman


"dodo" wrote in message
...
Hi there,

i am a newbie in excel vba and i made a simple macro but i miss
something there.

it is a macro that selects value of cell "A1" and then paste it in cell
"B1" quite simple ?, but my PROBLEM is that: the cell value "A1" isn't
numbers (it is something like 3+2*2) so when i paste it in "B1" i get
the same result of "A1" while i want to evalute "A1" , so any ideas.
THANX.









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cell Value

hi there,

that works for me but now i want to make the macro works in cells other than
"A1" & "B1"
e.g. take the numbers from cell "H4" for example and then evaluates it in
the active cell (already solved).

thanx




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Cell Value

Hi Dodo,

Try:

Dim Rng1 As Range, Rng2 As Range

Set Rng1 = ActiveCell
Set Rng2 = Range("H4")

Rng1.Value = Evaluate(Rng2.Value)


---
Regards,
Norman



"dodo" wrote in message
...
hi there,

that works for me but now i want to make the macro works in cells other
than "A1" & "B1"
e.g. take the numbers from cell "H4" for example and then evaluates it in
the active cell (already solved).

thanx



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cell Value

hi,

thanx Norman for the info so far but i still did not what i want to do.

ur code:
Dim Rng1 As Range, Rng2 As Range
Set Rng1 = ActiveCell
Set Rng2 = Range("H4")
Rng1.Value = Evaluate(Rng2.Value)

i did not mean "H4" to be constant, i want to make the Rng2 to be variable
in any cell and so for Rng1.

e.g.
A B C
1 2+3*5 MACRO OF SUM A1*B1
2 7+3*1 MACRO OF SUM A2*B2
3 6+5*2 MACRO OF SUM A3*B3

is it possible?

thank u


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
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Yuvraj Excel Discussion (Misc queries) 0 June 26th 09 06:01 PM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Worksheet Functions 1 August 22nd 08 02:04 AM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM
Question: Cell formula or macro to write result of one cell to another cell Frederik Romanov Excel Programming 1 July 8th 03 03:03 PM


All times are GMT +1. The time now is 10:50 AM.

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"