Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check a cell with a "X"

Status
Not open for further replies.

rampure

Technical User
May 16, 2007
17
US
Hi,

This is my first day and first question here.
I am trying to check a cell with a "X" if there is no data in the other cells.

For example - if c5=0 or j5 = 0, then I want X in B5.
I have this in the module.
sub name()
if(or(c5=0,j5=0),x,"")

But this didn't work.

Can someone help me with the steps? I am trying to write a module so it can be done automatically.

Appreciate your responses.

Thanks
Smitha
 
Code:
If [c5] = 0 And [j5] = 0 Then [b5] = "X"
will do it. The question is how do you want to fire off the macro? Do you want a button where you press it and it checks or do you want it to run the check after every change made in the worksheet?


[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 



Hi,

Do you want to push a button to run this macro or do you want some sheet event, like a change in row 5, to trigger this?

Do you ONLY want to do this for these two cells?

Skip,

[glasses] [red][/red]
[tongue]
 
[offtopic]
HA!
[/offtopic]

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
I want the macro to check for the rows and make changes in the inserted column.
I want to include this in the module that I have already created. And its not for 2 rows, more than 100 rows.

Thank You.
Smitha
 
This would not need to be done thru VBA you could use a standard Excel formula

=IF(OR(c5=0,j5=o),"X","")

Uncle Mike
 
Mike: see thread68-1368230.

Smitha: You didn't answer Skip's and my question: How do you want to make the macro run?

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 



Smitha,

You have been giving us bits and pieces of your requirement.

Why not just tell us what it is you need to do in painful detail; the columns containing data, the rows containing data, if there will be additional columns or rows of data that will be added by users, where the result should go, when it should run.

Skip,

[glasses] [red][/red]
[tongue]
 
My apologies to all of you for not giving you the details.

I am running a report on excel for products quarterly. So for every product I have data for 6 quarters. Now some of them might be discontinued, some of them new.

I have a macro which calculates the formulas and sorts the data range. Once this is done, I want to check whether there is data in all the 6 quarters and then insert a row and check if there is no complete data.

I do not want to delete the rows. I want to have it checked so that I can delete them if I don't want it. It is so much easier to analyse if I know that there is not full data for a product for all the 6 quarters.

I hope I am clear as to what I want and once again thanks to you for your responses.

Smitha
 
Thank you all. I recorded a new macro with the formula and it works like a charm.
Smitha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top