+ Reply to Thread
Results 1 to 3 of 3

using excel functions (concatenate and mid) in VBA

Hybrid View

  1. #1
    Registered User
    Join Date
    08-02-2004
    Posts
    12

    using excel functions (concatenate and mid) in VBA

    I am trying to write a formula in a cell using VBA but having difficulties breaking the text into 6 characters with a "." between the 6 and 7th character. I have written this

    ActiveCell.FormulaR1C1 = "=concatenate(mid('sheet1'!R[" & Range("StartRow") & "]c[-6],49,6)," & "" . "" & ", mid('sheet1'!R[" & Range("StartRow") & "]c[-6],55,2)"

    But it won't except the syntax for the "." ....

    Can you please advise how to add the ".", and better yet if it can be done without having to use concatenate.

    If i was to enter it as a formula in the cell i could just do this

    =MID('Sheet1'!B56,49,6)&"."&MID('Sheet1'!B56,55,2)

    Any suggestions please

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    How about

    ActiveCell.FormulaR1C1 = "=concatenate(mid('sheet1'!R[" & Range("StartRow") & "]c[-6],49,6)," & """ . """ & ", mid('sheet1'!R[" & Range("StartRow") & "]c[-6],55,2))"

    rylo

  3. #3
    Registered User
    Join Date
    08-02-2004
    Posts
    12
    Thank you so much, if only life's problems was this easy to solve

    Thank you thank you thank you

+ Reply to Thread

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