×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Macro code to paste objects...!
3

Macro code to paste objects...!

Macro code to paste objects...!

(OP)
How would I create a macro that if the value of the cell is positive will paste an object (shape) and if it is negative a different object (shape)

I guess what I'm looking for is a VBasic statement for if value in this range then ...

anybody can give me the basics....

Dumboy.! Ouch.! .my brain.....
spiderdesign@yahoo.com

It's hard to think with only one neuron......Ouch.....!....it hurts when I think......!

RE: Macro code to paste objects...!

3
How about something like this?  I am assuming that you are talking about Excel.


*****************

'dim a variable for each cell
dim c as range
'dim a variable for the range to work with
dim rngSearch as range

set rngSearch = YOURRANGE

for each c in rngSearch
   if c.value>0 then
      c.value = ONE OBJECT
   elseif c.value<0 then
      c.value = THE OTHER OBJECT
   end if
next c

***********

??  What if the value is exactly zero?

RE: Macro code to paste objects...!

(OP)
Kathryn... Thanks.... I think that surely will work....

Dumboy.! Ouch.! .my brain.....
spiderdesign@yahoo.com

It's hard to think with only one neuron......Ouch.....!....it hurts when I think......!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close