Advertisement

05.09.2008 at 12:07PM PDT, ID: 23390531
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Add row if ActiveCell matches text

Asked by VBAN in Microsoft Excel Spreadsheet Software

Tags: , ,

The following code makes two things happen.
1) If date is entered in column 12 then the result of the entered date subtracted from Now() will be placed in another cell in column 2.

2) If the data in the active cell in column O matches "Yes" then insert EntireRow below.

Problem:
I need to add the 2nd thing into the first thing.  In other words, I cannot figure out how to get the 2nd thing to activate when I type "Yes" into the active cell in column O.  I tried inserting a Call Addrow into the Worksheet_Change but it was acting funny.  Please help!!

I have named column 12 as "A" and column O as "B" on my worksheet but am not able to use the names in the below code.  I was able to get the code to work using the column name as a reference but then when I inserted a new column everything got messed up.  Any ideas?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim targ As Range
Dim Date1 As Variant
Dim Date2 As Variant
Dim X As Integer
Dim MyRange As Range
Dim MatchString As String
 
X = 5
 
Set targ = Intersect(Range("L5:L65536"), Target)
If (Not targ Is Nothing) Then
    Do While Not IsEmpty(Cells(X, 12))
    Date1 = CDate(Cells(X, 12))
    Date2 = Now()
    If IsDate(Date2) And IsDate(Date1) Then
        Cells(X, 2) = DateDiff("d", Now(), Cells(X, 12))
    Else
        MsgBox ("Type valid date in Deadline cell")
    End If
    X = X + 1
Loop
Else
Set targ = Intersect(Range("O5:O65536"), Target)
If (Not targ Is Nothing) Then
Call Addrows
Else
End If
End If
 
End Sub
 
 
Sub Addrows()
     
    Dim MyRange As Range
    Dim MatchString As String
     
    On Error Resume Next
    Set MyRange = Columns("O")
    On Error GoTo 0
     
    If MyRange Is Nothing Then Exit Sub
     
    MatchString = ActiveCell.Value
    If MatchString = "Yes" Then
        ActiveCell.Offset(-1).EntireRow.Insert
 
End If
         
End Sub
[+][-]05.09.2008 at 12:33PM PDT, ID: 21535804

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 02:30PM PDT, ID: 21550683

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 10:07PM PDT, ID: 21552455

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 07:49AM PDT, ID: 21564812

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 08:00AM PDT, ID: 21564946

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 06:48AM PDT, ID: 21573563

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 07:16AM PDT, ID: 21573860

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 09:10AM PDT, ID: 21575193

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 11:37AM PDT, ID: 21576770

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 12:35PM PDT, ID: 21577224

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 02:12PM PDT, ID: 21586489

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 06:39PM PDT, ID: 21587671

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Excel Spreadsheet Software
Tags: Microsoft, Excel, 2003
Sign Up Now!
Solution Provided By: chris_bottomley
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.20.2008 at 04:37PM PDT, ID: 21611182

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628