Posts by the Okk

    Re: Getting The Cell Index For A Function Not The Cells Value


    Quote from nb-


    It Looks like simple formula:
    =A1/(OFFSET(A1,-par1)+OFFSET(A1,par2))
    Are you sure you need UDF?

    Re: Use Of Conditional Format For More Cells


    Quote from diku

    But on same condition (D8=0) I like to make all column D with red Pattern Background.
    How is that possible?


    Select Range you want to format. Menu bar -> Format -> Conditional Formatting. Use Formula: =NOT($D$8)

    Re: Number Of Rows In A Range After Filter


    Quote from Scottintexas

    I have applied a filter to my worksheet and would like to know if there is a way to get the number of rows included in the resulting filtered data.


    Code
    Worksheets("All Work").Select
        iCount = GetEnd(Worksheets("All Work"))
        Set Cell1 = Cells(2, 1)
        Set Cell2 = Cells(iCount, 6)
        Worksheets("All Work").Range(Cell1, Cell2).AutoFilter Field:=7, Criteria1:="Unassigned"


    Now that I have it filtered I need to know how many rows are there with data.


    You need to count visible Rows of your range? Then:

    Code
    lngVisibleRowsCount = Worksheets("All Work").Range(Cell1,Cells(icount,1)).SpecialCells(xlCellTypeVisible).Cells.Count

    Re: Error In Finding Date In Another Range



    Can you give us an example of your file?

    Re: Error In Finding Date In Another Range


    Quote from tardy

    Is there a way for the macro to pickup this date format instead of the string/formula in C1?


    Something like that?:

    Re: Error In Finding Date In Another Range


    Quote from tardy


    Is there a way for the macro to pickup this date format instead of the string/formula in C1?


    Have you tried:

    Code
    Dim today As Date

    ?
    What exactly you want to find? TODAY()? Or WORKDAY?

    Re: Error In Finding Date In Another Range


    Re: Accessing Isblank In Vba


    Quote from Om Avataar

    Is the following valid code in Excel VBA?


    Code
    If Application.WorksheetFunction.isblank(Cells(RowIndex, ColIndex)) Then


    Thanks


    Do you use some Loop? The best way for it:

    Code
    For each EmptyCell in YourRange.SpecialCells(xlCellTypeBlanks)
    Next EmptyCell


    or

    Code
    For each NonEmptyCell in YourRange.SpecialCells(xlCellTypeConstants)
    Next NonEmptyCell


    Or you can Access to IsBlank function by:

    Code
    If Evaluate("Isblank(" & Cells(RowIndex, ColIndex).address & ")") Then


    But I suggest you to use SpecialCells method if it's possible.

    Re: Run-time Error 2147352571(8002005).


    Quote from pjcw

    The error is displayed as a "Type Mismatch", but not the usual error number of 13.


    Then try:

    Code
    cbxCaseType.Clear 
    cbxCaseType.AddItem "Blank" 
    Application.ScreenUpdating = False 
    Dim cell As range 
    For Each cell In Worksheets("Index").Columns(1). _
      Resize(Rows.count-1).Offset(1). _
      SpecialCells(xlCellTypeConstants) 
        cbxCaseType.AddItem CStr(Cell.value)
    Next Cell
    TP.Activate

    Re: Run-time Error 2147352571(8002005).


    Quote from pjcw

    I have an Excel system containing VBA code and forms. A combobox, whose list is created within the VBA code works throughout the UK without problems, but when sent to a user in France, gets the above error. The code is below.


    Code
    Top:
        If Cells(N, 1) = "" Then GoTo Done
        cbxCaseType.AddItem Cells(N, 1)   ' This line causes the error in France
        N = N + 1
        GoTo Top
    Done:


    Code
    Dim cell As range
    For each cell in Columns(1).Resize(Rows.count-1).Offset(1). _
    SpecialCells(xlCellTypeConstants)
    cbxCaseType.AddItem Cell.value
    Next Cell


    What type of error? Are there some description?

    Re: Search For A String. Then Copy All Cells Between Each Occurrence


    Quote from khalel04

    Hi Jindon/the OKK,


    Both script you made, it just copied the whole data into column B.


    Try this one:

    Re: Search For A String. Then Copy All Cells Between Each Occurrence


    You can use Advanced Filter to copy filtered values to another place. This macro can do it for you:

    Re: Speed Up For Each Cell Code


    Quote from royUK

    Why select?


    Why Loop?

    Re: Create Range Box On Form


    Quote from shg

    Can someone tell me how to create a 'range box' on a form that allows you to drag and select a range, like a type 8 InputBox?


    Thanks in advance,


    Microsoft Office Spreadsheet Control