Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 30 of 30

Thread: Formatting issues

  1. #21
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    @Paulked, I notice the use of Chrw(176), Chrw(39), Chrw(34), Chrw(&H2032) & Chrw(&H2033). I've not seen that before and was wondering if it should be Chr$ rather than Chrw?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  2. #22
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    Hey ho, it seemed to be a good article, shame it didn't produce.
    Semper in excretia sumus; solum profundum variat.

  3. #23
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Quote Originally Posted by Aussiebear View Post
    Sorry Paul but your file when used on my data converts South DMS to West and is missing the negative sign in front of the result.
    1. Which Paul?

    2. Probably me, since I did not use a minus sign.

    But I think the conversion is correct

    Capture.JPG


    Did you have the second parameter = 1 since I changed the call format in my sub?

    ' Converts decimal latitude, longitude or azimuth value to degrees/minutes/seconds string format'   ConvType          = -1 Longitude,            = 0 Azumuth,           = 1 Latitude


    However, if you have DMS with the trailing "S" do you want the leading "-" also?



    The original sub used trailing N/E/S/W so I just followed their approach


    Having both seems redundant and possibly ambiguous (since -10 S could be interpreted as +10 N), but if you want the "-" and/or no trailing NESW, it's easy enough to change my function
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  4. #24
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Quote Originally Posted by Aussiebear View Post
    @Paulked, I notice the use of Chrw(176), Chrw(39), Chrw(34), Chrw(&H2032) & Chrw(&H2033). I've not seen that before and was wondering if it should be Chr$ rather than Chrw?
    ChrW is for Unicode (2 byte) characters, but since you're on a Mac, I don't think you'd want ChrW


    https://docs.microsoft.com/en-us/off...p/chr-function


    Chr(charcode)
    ChrB(charcode)
    ChrW(charcode)

    The required charcode argument is a Long that identifies a character.
    Remarks

    Numbers from 0–31 are the same as standard, nonprintable ASCII codes. For example, Chr(10) returns a linefeed character. The normal range for charcode is 0–255. However, on DBCS systems, the actual range for charcode is -32768–65535.

    Note

    The ChrB function is used with byte data contained in a String. Instead of returning a character, which may be one or two bytes, ChrB always returns a single byte.
    The ChrW function returns a String containing the Unicode character except on platforms where Unicode is not supported, in which case, the behavior is identical to the Chr function.

    Note
    Visual Basic for the Macintosh does not support Unicode strings. Therefore, ChrW(n) cannot return all Unicode characters for n values in the range of 128–65,535, as it does in the Windows environment. Instead, ChrW(n) attempts a "best guess" for Unicode values n greater than 127. Therefore, you should not use ChrW in the Macintosh environment.
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #25
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    As I said, I found that on the web, I'll go with Paul H said above
    Semper in excretia sumus; solum profundum variat.

  6. #26
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Quote Originally Posted by paulked View Post
    As I said, I found that on the web, I'll go with Paul H said above

    Not me. It was Microsoft what dun it
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #27
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    Semper in excretia sumus; solum profundum variat.

  8. #28
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Thank you to both of you
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  9. #29
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    End result here.... ditched both Mac's ( for calculating this file) and purchased a Dell laptop. It runs the Vincent functions brilliantly. Thanks to all you contributed.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  10. #30
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    Expensive fix! I don't have a Mac so I can't compare the two, but I would have thought that any computer would calculate a formula to get the same result... isn't that what they are for?

    Anyway, good to know you're sorted
    Semper in excretia sumus; solum profundum variat.

Posting Permissions

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