Search:

Type: Posts; User: ZVI; Keyword(s):

Page 1 of 6 1 2 3 4

Search: Search took 0.14 seconds.

  1. Replies
    2
    Views
    83

    Re: Workbook & File SaveCopyAs

    Hi,

    When you manually set macros of a template workbook to controls added on a QAT or on a Custom Ribbon tab, then link to the full path name of that template workbook is established.
    To solve...
  2. Re: VBA - evaluate if a cell is formatted as a date (of *any* date type)

    And usually if cell has formula then calendar do not appear, or at least should not change that cell's value to prevent formula disappearing.
    If Target(1).HasFormula Then Exit Sub
  3. Re: VBA - evaluate if a cell is formatted as a date (of *any* date type)

    On my testing it does not work correctly with some date formats of cells.
    Seems this works more correctly:


    If VarType(Target(1).Value) = vbDate Or Val(Format(0, Target(1).NumberFormat)) <> 0...
  4. Re: VBA - evaluate if a cell is formatted as a date (of *any* date type)

    Hi Rick,
    Good point - thank you!
    This can be used for data value and empty value:


    Dim vt As VbVarType
    vt = VarType(Target(1).Value)
    If vt = vbDate Or vt = vbEmpty Then
    ...
  5. Re: VBA - evaluate if a cell is formatted as a date (of *any* date type)

    Hi Mike,

    To show form on empty cell too, the code might be as follows:


    If IsDate(Target(1).Value) Or IsEmpty(Target(1).Value) Then
    MonthView.Show
    Cancel = True
    End If
  6. Replies
    17
    Views
    483

    Re: Cannot run macro from add-in.

    Good job! Nice to know you have made it out!

    Your method is better than copying code from the AddIn into module of Book1 - code is stored in one place without doubling.

    Macro is assigned to...
  7. Replies
    1
    Views
    89

    Re: Linking to Drop Down List

    Hi,

    Create named range for cells in any sheet and then in validation list refers to that name instead of direct referencing to those cells.

    Regards
  8. Re: VBA: How to delete Name Range based on Name + Scope

    Hi,
    Try the below code:


    Sub NamesAdd()
    ThisWorkbook.Names.Add "MyName", RefersTo:="Workbook name"
    ThisWorkbook.Sheets(1).Names.Add "MyName", RefersTo:="Sheet name"
    End Sub

    Sub...
  9. Replies
    17
    Views
    483

    Re: Cannot run macro from add-in.

    There are some points:

    1. According to your initial code - Book1.XLSM!Open_xxxxxxx , the code of Open_xxxxxxx should be in Book1.xlsm not in the AddIn. May be something went wrong during...
  10. Re: VBA - evaluate if a cell is formatted as a date (of *any* date type)

    Use this in BeforeDoubleClick event code:


    If IsDate(Target(1).Value) Then
    MonthView.Show
    Cancel = True
    End If

    Regards
  11. Replies
    17
    Views
    483

    Re: Cannot run macro from add-in.

    Hi,

    Try using Run, like this:
    Run "Book1.xlsm!Open_xxxxxxx"

    Regards
  12. Replies
    1
    Views
    371

    Re: Since O365 -> macro pdf to e-mail is failing

    Hi, try this modification of the code:


    ' Define PDF filename
    'PdfFile = ActiveWorkbook.FullName
    PdfFile = Environ("Temp") & "\" & ActiveWorkbook.Name

    Regards
  13. Replies
    23
    Views
    950

    Re: VBA automate IE actions

    If code doesn't work, to test on myside, what are valid values of A2 and B2 in Sheet1?
  14. Replies
    23
    Views
    950

    Re: VBA automate IE actions

    See the new code line in Red:


    ' --> Wait for the document to load
    While objIE.Document Is Nothing
    DoEvents
    Wend
    ' <-- End of waiting

    'for each element in the...
  15. Replies
    23
    Views
    950

    Re: VBA automate IE actions

    My assumption was based on the fact the code is working in debugging mode.
    But seems this line of the code is missing: result = Text.innerText inside the For-Each loop.
    In the posted code the...
  16. Replies
    23
    Views
    950

    Re: VBA automate IE actions

    Hi and welcome to the forum!
    Try inserting this code just before your For Each Text... part


    ' --> Wait for the document to load
    While objIE.Document Is Nothing
    DoEvents
    ...
  17. Replies
    13
    Views
    524

    Re: HOW i can split data !

    Try this:


    Sub SplitText2()

    Dim a As Variant, b() As String, Part As Variant, LPart As String
    Dim i As Long, j As Long, k As Long

    ' Find row of the destination cell
    i =...
  18. Re: Need vba to download and copy the data from zip file

    You are welcome, thanks for the feedback! :)
  19. Re: Need vba to download and copy the data from zip file

    Hi, try this then:


    Dim MonthName As String
    MonthName = [TEXT(NOW(),"MMM")]
    UrlFile = "https://www.nseindia.com/content/EQUITIES/" & [TEXT(NOW(),"YYYY/MMM/c\mDDMMMYYYY")] & "bhav.csv.zip"...
  20. Replies
    6
    Views
    214

    Re: VBA for calculating Average

    Glad it helped, Peter!
    :beerchug:
  21. Re: Need vba to download and copy the data from zip file

    Hi & welcome to MrExcel Board!
    Use this line in the code to get a date dependent url:


    UrlFile = "https://www.nseindia.com/content/EQUITIES/" & [TEXT(NOW(),"YYYY/MMM/c\mDDMMMYYYY")] &...
  22. Re: VBA to extract variable length number, following a variable character

    Try this user defined function:


    Function GetNumber(Txt As String)
    ' Returns number in Txt by the template:
    ' ("N" or "OMGI_STRALC") & optional_dot & optional_space & number & space
    ' Usage in...
  23. Replies
    6
    Views
    214

    Re: VBA for calculating Average

    This is faster alterrnative code:


    Sub AvgCal1()
    Dim LastCol As Long, LastRow As Long
    Dim rng As Range
    With Range(ws2.Range("A1"), ws2.UsedRange)
    LastRow = .Rows.Count
    LastCol...
  24. Replies
    6
    Views
    214

    Re: VBA for calculating Average

    This can happen if sum = 0 and count = 0.
    Use this modified code line:
    If count > 0 Then ws3.Cells(2, c).Value = sum / count

    or better:


    If count > 0 Then
    ws3.Cells(2, c).Value =...
  25. Re: VBA to extract variable length number, following a variable character

    Hi,
    You may also try this user defined function solution:


    Function GetNumber(Txt As String)
    ' Returns number in Txt by the template:
    ' not_digit & dot & (optional)space & number & space
    '...
Results 1 to 25 of 150
Page 1 of 6 1 2 3 4