Technology, Web & Business Forum

You are here: Technology, Web & Business Forum : Web Development : Content Management : How do I write this script for Excel? If contents in cell E5:E475 = "xxx", then


Welcome to the Technology, Web & Business Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.


Content Management Discuss web content management systems (CMS) and blogging


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-02-2008
Junior Member
 
Join Date: Jun 2008
Posts: 1
Default How do I write this script for Excel? If contents in cell E5:E475 = "xxx", then

delete contents of A5:A475 I need to get a script for my excel sheet that will delete the contents of A5, if E5 = a date (This date varies every day). The contents of A5 are simply a period, to help with a formula I'm doing. Once I put a date into E5, I want that period to be deleted automatically. As well, I need the same thing to be done from A5 down to A475, corresponding with E5 down to E475. There's 6 worksheets in this workbook, and this will need to be done 5 or 6 times on each sheet. A5 to E5, G5 to K5, L5 to P5, and so on...

Does that make sense? Is there an easier way to do this? Thank you!
Specifically, if E5 or E6 or E7, etc are a date (5/19/08, 5/20/08, etc), then A5 or A6 or A7 contents need to be deleted. Maybe that clears things up!
__________________
Powered by Yahoo! Answers
Reply With Quote
  #2 (permalink)  
Old 06-02-2008
Junior Member
 
Join Date: May 2008
Posts: 3
Default

Well, if you want to clear contents you're going to need to run a vb script. I'm not sure if that's what you're looking for but i'll give you a simple answer since I don't know a ton about vba and I would basically have to record and re-write a macro for it.

I'm going to assume that this date you're talking about that changes daily can be put in a cell, let's say that cell is "A1"

Here's what you would put in A5

=IF(E5=$A$1,"",".")

What that will do is create a blank cell if E5 matches your date, and if it does not match that cell, it will put a period in the cell for you.

I don't know if that helps or not but good luck!
__________________
Powered by Yahoo! Answers
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 09:51 PM.