Results 1 to 5 of 5

Countif Value problem

Threaded View

  1. #1
    Registered User
    Join Date
    09-02-2008
    Location
    Richmond
    Posts
    71

    Countif Value problem

    I have a code that opens another workbook and looks at some cells and then returns the values. The problem is F20 in the opening document has a countif and gives the value but when it comes back into the main file it has the formula and not the value

    Private Sub DownloadDR_Click()
     Dim wb As Workbook
      Dim s As String
      Dim dName As String
      dName = Format(CDate(Range("c3").Value), "mmddyy")
    
    TextBox5.Text = dName
      
       s = Worksheets(1).TextBox5.Value
        
      Application.ScreenUpdating = False ' turn off the screen updating
      'Set wb = Workbooks.Open("m:\cir at a glance\dsi reports\" & TextBox3.Value & ".xls", True, True)
      Set wb = Workbooks.Open("M:\Cir at a Glance\Down Route Report\Brandermill  Down Route Report " & s & ".xls", True, True)
      ' open the source workbook, read only
      With ThisWorkbook.Worksheets(1)
      ' read data from the source workbook
    '.Range("c42").Formu1a = wb.Worksheets(s).Range("l2").Formula & "+" wb.Worksheets(s).Range("N2").Formula
    '.Range("d42").Formula = wb.Worksheets(s).Range("A20").Formula
        .Range("c54").Formula = wb.Worksheets(s).Range("f20").Formula
        .Range("d54").Formula = wb.Worksheets(s).Range("c4").Formula
      End With
      wb.Close False ' close the source workbook without saving any changes
      Set wb = Nothing ' free memory
      Application.ScreenUpdating = True ' turn on the screen updating
    End Sub

    =COUNTIF(myChecks, "a")
    This is used by check boxes and then adds up all the check in F20
    Last edited by VBA Noob; 11-09-2008 at 03:45 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1