Results 1 to 10 of 18

Thread: Initial capital customized

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    15
    Hi,

    snb, I tested the code in the loop Vb6 and work perfectly

    Sub M_snb()
    sn = [B3:B12]

    For j = 1 To UBound(sn)
    sn(j, 1) = Replace(Replace(StrConv(Replace(Replace(sn(j, 1), ".", ". "), "/", "/ "), 3), ". ", "."), "/ ", "/")

    st = Split(sn(j, 1))
    For jj = 0 To UBound(st)
    If st(jj) Like "*[0-9]*" Then st(jj) = UCase(st(jj))
    Next
    sn(j, 1) = Join(st)

    For Each it In Split("di da con per mm in a e la le")
    If InStr(1, sn(j, 1) & " ", " " & it & " ", 1) Then sn(j, 1) = Trim(Replace(Replace(sn(j, 1) & " ", " " & UCase(it) & " ", " " & it & " "), " " & StrConv(it, 3) & " ", " " & it & " "))
    Next
    Next

    [G3:G12] = sn
    End Sub

    Rick Rothstein
    I tried the code with Excel, perfect
    note: Not available in Vb6 code: Application.Proper

    Thank you all for the suggestions received

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    15
    Quote Originally Posted by PcMax View Post
    Rick Rothstein
    I tried the code with Excel, perfect
    note: Not available in Vb6 code: Application.Proper
    Are you using the VB6 inside of Excel or the compiled version of Visual Basic 6? If you are using the VB6 inside of Excel, what version of Excel are you using? Just so you know, I tested the code before I posted it and what I posted works for me in my copies of XL2003, XL2007 and XL2010 and I can see no reason why it would not work in XL2013 and XL2016 (when released).

    If you still have trouble with the code, try replacing Application.Proper with WorksheetFunction.Proper and see if that solves your problem.

    Edit Note: Do you have a procedure or function or macro named Proper? If you do, there is a chance using that name is interfering with the attempted use of Proper when called from the Application object.
    Last edited by Rick Rothstein; 09-19-2015 at 02:41 AM.

Posting Permissions

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