Wednesday, March 30, 2016

Activating a macro based on the value of a text cell. Also, send a message to user when a condition exists [Anwsered]

Activating a macro based on the value of a text cell. Also, send a message to user when a condition exists

If A1 = a specific text value, I want to run a macro that that changes to a custom view in which A2 is visible. If A1 is does not equal that specific text value I want a different maco which hides A2.  I know how to create custom views, and how to record
a macro, however; I don't think I know how to activate a macro based on the text value of a cell.
Also, if A1 = a specific text value then A2 must contain a numeric value.  If the user fails to enter the numeric value then I want a dialog box to pop open and remind them to do so.  If A1 is blank then A2 should also be blank which will be no problem since
it will be hidden.
 
Thanks.

Solutions to the Problem Activating a macro based on the value of a text cell. Also, send a message to user when a condition exists

Download SmartPCFixer for Free Now

Hi Lilly,
There are several steps to doing what you want to do.
The key is what developers call "trapping the event" and choosing the event you want.
In this case, you want to put your code in the worksheet that you have the A1 you are checking, and trap the events
Worksheet_Activate and Worksheet_Change.
This ensures that every time the user opens or switches to your worksheet, that cell is checked

Private Sub Worksheet_Activate()
    CheckA1
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
    CheckA1
End Sub


Public Sub CheckA1()
    If Me.Range("A1").Value = "Y" Then
        Rows("1:3").Select
        Selection.EntireRow.Hidden = False
        Me.Range("A2").Select
    Else
        Rows("2:2").Select
        Selection.EntireRow.Hidden = True
        Me.Range("A1").Select
    End If
    
End Sub

That takes care of the showing and hiding.
Now for ensuring only numbers.
For that you need the Data tab and to choose "Data Validation" I don't see a way to attach screen shots here, but basically you tell data validation you want a number within a certain
range (if you just need any number choose >=0) and tell it what information you want to give the user if they put a wrong value in.
Make sure to check "Ignore Blanks" so if the user hasn't entered anything or doesn't need to you do not get a validation error.

Good luck!
Joey

Running System Update Readiness Command

On running the System Update readiness Command, it will Detect & Replace Incorrect Registry data with the Correct one. Which may ultimately Solve Activating a macro based on the value of a text cell. Also, send a message to user when a condition exists in Windows.

  1. Open CMD as Administrator by Simply Right Clicking on Start button > Command Prompt (Admin).
  2. Now Type or Copy paste "DISM.exe /Online /Cleanup-image /Scanhealth" and hit Enter,
  3. Now again Type or Copy paste this "DISM.exe /Online /Cleanup-image /Restorehealth" and hit Enter.
  4. Close the Command Prompt Window because we are done.

Try and see if you still get the same error Activating a macro based on the value of a text cell. Also, send a message to user when a condition exists in your Windows.

Note: You may be prompted to enter your administrator's password when you try to execute certain system tasks!

Another Safe way to Repair the Problem: Activating a macro based on the value of a text cell. Also, send a message to user when a condition exists:

How to Fix Activating a macro based on the value of a text cell. Also, send a message to user when a condition exists with SmartPCFixer?

1. Download SmartPCFixer . Install it on your computer.  Click Scan, and it will perform a scan for your computer. The errors will be shown in the scan result.

2. After the scan is done, you can see the errors and problems need to be repaired. Click Fix All.

3. When the Fixing part is finished, your computer has been speeded up and the errors have been fixed


Related: [Solved] Applications have stopped working with SP1 on Windows 7!,[Solved] I can't find auto complete text in word 2007,[Solution] I need to keep reinstalling eHome Infrared Transceiver driver everytime my computer shuts down.,How to Resolve - system restore not working windows 7?,Unable to open embedded word file on the intranet. [Solved],Solution to Error: Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive.
,Troubleshoot:External Hard Drive not listed in Windows 7 backup wizard Error
,I'm always being signed off so annoying Tech Support
,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.
,Solution to Problem: Referencing data in another file
,[Anwsered] Thinkpad 8611 Boot,How to Resolve - Svchost Helper?,Fast Solution to Problem: L30 101 Driver Windows 7,Troubleshooter of Error: Io Device,How to Fix Error - Dell Laptop Code 39?
Read More: Troubleshooter of Error: A Font bug in Celtx software,Troubleshooting:8000FFF KB978506 KB976972 KB977074 Windows 7,Acer 4801T Windows 7 freezes during audio and video playback,How to Fix - acess and mail postak service e-mail?,Fast Solution to Problem: Accidentally deleted my recovery partition,Cannot delete empty file icon on desktop...,Cannot download flashplayer,can't get the CIA review progrom install which is an older version,Cannot access one website-DNS server not responding.,Can't Receive or Send Vista Windows Mail - Router stopped recognizing DSL connection & wants to dial up

No comments:

Post a Comment