Do not use on any
shared computer
August 29, 2008 08:08pm pdt
 
[x]
Attachment Details

Errors In my VBA Code

Can someone look at my code. A few thing are braking and I dont understand why.

1. I am try to see if a cell is empty when I use this:IsEmpty(RefSACell) <> True & IsEmpty(SATargetCell) I get a mismatch error. So I tried this:InnvationCell.Text <> "" & StrategicCell.Text <> "" and it gives no errors but it doesnt work the text property of each of these cells is "" but the code goes into the If statement.

2. Then in my CreateBar sub I get the error Unable to get the Match property of the WorksheetFunction Class
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:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
Public Sub TimelineGraph()
 
 Dim InnvationCell, StrategicCell, DevelopmentCell, RefCell, RefSACell, SATargetCell As Range
Dim Cell As Range
Dim Count As Integer
 
Do
   For Each Cell In Intersect(Sheets("C").UsedRange, Sheets("CXD Program Status").[B6:B65536])
      If Len(Cell) > 0 Then
        
          If IsEmpty(Cell) <> True Then
    
    'set the dates in the cells
    Set InnvationCell = Cell.Offset(0, 6)
    Set StrategicCell = Cell.Offset(0, 7)
    Set DevelopmentCell = Cell.Offset(0, 8)
    Set RefCell = Cell.Offset(0, 9)
    Set RefSACell = Cell.Offset(0, 10)
    Set SATargetCell = Cell.Offset(0, 11)
    
    'Dim row As Long
    If InnvationCell.Text <> "" & StrategicCell.Text <> "" Then
       'row = FindName(Cell.Value)
       
        Call CreateBar(Cell.Value, CDate(InnvationCell.Value), CDate(StrategicCell.Value), 45)
    End If
    
    If IsEmpty(DevelopmentCell) <> True & IsEmpty(StrategicCell) <> True Then
        Call CreateBar(Cell.Value, CDate(StrategicCell.Value), CDate(DevelopmentCell.Value), 6)
    End If
    
    If IsEmpty(DevelopmentCell) <> True & IsEmpty(RefCell) <> True Then
        Call CreateBar(Cell.Value, CDate(DevelopmentCell.Value), CDate(RefCell.Value), 5)
    End If
    
    If IsEmpty(RefSACell) <> True & IsEmpty(RefCell) <> True Then
        Call CreateBar(Cell.Value, CDate(RefCell.Value), CDate(RefSACell.Value), 4)
    End If
    
    If IsEmpty(RefSACell) <> True & IsEmpty(SATargetCell) <> True Then
        Call CreateBar(Cell.Value, CDate(RefSACell.Value), CDate(SATargetCell.Value), 39)
    End If
    
    If IsEmpty(SATargetCell) <> True Then
    
    End If
    
    
    End If
       
      
         'Cell.Offset(0, 3) = Cell
         Count = 0
      Else
         Count = Count + 1
         If Count >= 3 Then Exit Do
      End If
   Next Cell
   Exit Do
Loop
End Sub
 
Public Sub CreateBar(ByVal sName As String, ByVal startDate As Date, ByVal endDate As Date, ByVal iColor As Integer)
    Dim lRow As Long
 
    startDate = startDate - (Weekday(startDate, vbMonday) - 1)
    
    endDate = endDate + (7 - Weekday(endDate, vbMonday))
    
    With Application.WorksheetFunction
        lRow = .Match(sName, Columns(1), 0)
    End With
    
    With Sheets("CX").Range("D" & lRow & ":EY" & lRow)
        .FormatConditions.Delete
        .FormatConditions.Add xlExpression, , _
        "=AND(R[" & -lRow + 2 & "]C>=DATEVALUE(""" & startDate & """),R[" & -lRow + 2 & "]C<=DATEVALUE(""" & endDate & """))"
        
        .FormatConditions(1).Interior.ColorIndex = iColor 'green
     
    End With
 
End Sub
Start your free trial to view this solution
[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!

Question Stats
Zone: Software
Question Asked By: npl77
Solution Provided By: jell
Participating Experts: 5
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by angelIII

Rank: Genius

Expert Comment by angelIII:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by aiklamha

Rank: Master

Expert Comment by aiklamha:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by saurabh726

Rank: Genius

Expert Comment by saurabh726:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by aiklamha

Rank: Master

Expert Comment by aiklamha:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by saurabh726

Rank: Genius

Expert Comment by saurabh726:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by saurabh726

Rank: Genius

Expert Comment by saurabh726:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by saurabh726

Rank: Genius

Expert Comment by saurabh726:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by saurabh726

Rank: Genius

Expert Comment by saurabh726:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by saurabh726

Rank: Genius

Expert Comment by saurabh726:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by saurabh726

Rank: Genius

Expert Comment by saurabh726:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by saurabh726

Rank: Genius

Expert Comment by saurabh726:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by GrahamSkan

Rank: Genius

Expert Comment by GrahamSkan:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by jell

Rank: Guru

Accepted Solution by jell:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by GrahamSkan

Rank: Genius

Expert Comment by GrahamSkan:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by npl77
Author Comment by npl77:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Assisted Solution by GrahamSkan

Rank: Genius

Assisted Solution by GrahamSkan:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628