• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Please help me with this VBA code (If statement)

Status
Not open for further replies.

Pasadu

Member
I have two empty Cells where i will surely enter data. But one data is dependent on the other. If Cell A1 is empty, Cell B1 should be blocked that data cannot be entered. However, if Cell A1 is filled(Date), then Cell B2 can also be filled with date. In other words, Cell B2's date can only be filled when Cell A1's Date has been filled. If A1's date has not been filled, B2 should be blocked from receiving any data. Thank You.
 
Pasadu
Do You skipped Forum Rules instruction...
Please post, new posts in the correct forums
You opened Your thread to Ask an Excel Question
instead of VBA Macros

Which seems more near based Your writing.
In this time, I'll move this to correct forum.
 
Thank you. It worked exactly as i wanted but i tried extending it to other cells by dragging but it failed. Please ignore A1 and B1 and use these exact cells. If L4 is empty, M4 should not be able to receive any input. Then, do same for L5 and M5, L6 and M6, L7 and M7, L8 and M8, ***** L18 and M18.
Thank You.
 
Pasadu
Did You give any hint that You would like to get something else to work than those A1 & B1 which You asked?
Where did You get an idea that .... dragging ... could work?
Your
should not be able to receive any input ...hmm? If You write there a formula ( eg = x1 ) ... then input could change ... hmm?
... Should that be empty then?

What would Your ***** mean?
Do You know now - what do You would like to want?
 
I am sorry. I have attached the file now. What i will like to do is this. When L4 is empty, M4 should not be able to receive any value. M4 can only receive input when L4 is not empty. After, i want the same for L5 and M5, L6 and M6, L7 and M7, L8 and M8, L9 and M9, L10 and M10, L11 and M11, L12 and M12, L13 and M13, L14 and M14, L15 and M15, L16 and M16, L17 and M17, L18 and M18.
Also, I want to lock the worksheet so that it cannot be scrolled. I want to set the scroll from A1 to O23.
 

Attachments

  • Meridian Port Services 1.xlsm
    140.6 KB · Views: 1
Pasadu
Did You answer all questions?
Is there anything else that You ... want?

Why there are three Workbook_Open -codes?
 
Last edited:
I thought i could do it once you do only A1 and B1 but i was wrong. Now, I want to extend the formulae to other cell downwards. This time, it is not A1 and B1. It is L4 and M4, L5 M5, L6 M6, L7 M7, L8 M8, L9 M9, L10 M10, L11 M11, L12 M12, L13 M13, L14 M14, L15 M15, L16 M16, L17 M17 and L18 M18.
 

Attachments

  • Meridian Port Services 1.xlsm
    140.6 KB · Views: 0
Pasadu
I don't use ... formulae.
This should take care those as You have written in this time (replies #5 & #8).
Note: as You've used cross-posting without let other know as written in Forum Rules
I can wish You ... take care.
 

Attachments

  • Meridian Port Services 1.xlsm
    143 KB · Views: 5
Last edited:
Thank you so much, it worked PERFECTLY as i wanted. But please, i want another situation whereby when i close the worsksheet, both A4 and A7 should return to EMPTY. For example, if before closing the worksheet, I input A4=value, and or A7 also has a value, i want both A4 and A7 to be made EMPTY. In summary, all i want is that anytime i open the worksheet, A4 and A7 should be empty.
 
Pasadu
#1 I've already asked
(#5 reply)
Is there anything else that You ... want?
Why there are three Workbook_Open -codes?

(#9 reply)
Note: as You've used cross-posting without let other know as written in Forum Rules
I can wish You ... take care.

Seems that You skip questions as well as You don't want to follow basic rules.
You still continue write
...
i ( Pasadu) want
... should these work that Your way?
 
#9 Alright, i am sorry because i am new to this platform, i have just been here for 1 day; so i have now read the guidelines and now understands how this platform works. I am sorry.

#5a Yes please. i want another situation whereby when i close the worksheet, both A4 and A7 should return to EMPTY. For example, if before closing the worksheet, I input A4=value, and or A7 also has a value, i want both A4 and A7 to be made EMPTY. In summary, all i want is that anytime i open the worksheet, A4 and A7 should be empty.

#5bThere may be codes because i just kept on trying how to do what i wanted to do; but when i could not do, that is when i decided to contact this platform for help. All codes can be deleted excepted the "welcome message."
 

Attachments

  • Meridian Port Services 1.xlsm
    141.9 KB · Views: 4
As a reminder : any Excel forum expects the initial post to be crystal clear, well elaborated with details so with nothing to guess​
and a bonus to help is an attachment well reflecting the before state and the expected result so the solution comes in post #2 …​
 
Sir, I want to hide all the sheets except the MPS Sheet. I want to hide it to the point that nobody can see or unhide it. Please teach me how i can unhide too it since i will be making adjustments on the figures please. I have attached the file. Thank You.
 

Attachments

  • Meridian Port Services 1.xlsm
    145.5 KB · Views: 2
Status
Not open for further replies.
Back
Top