+ Reply to Thread
Results 1 to 5 of 5

Help with Quotation Mark.

Hybrid View

bbmak Help with Quotation Mark. 06-10-2014, 08:15 PM
6StringJazzer Re: Help with Quotation Mark. 06-10-2014, 09:02 PM
bbmak Re: Help with Quotation Mark. 06-11-2014, 11:59 AM
shg Re: Help with Quotation Mark. 06-11-2014, 12:14 PM
bbmak Re: Help with Quotation Mark. 06-11-2014, 12:29 PM
  1. #1
    Registered User
    Join Date
    05-21-2014
    Posts
    30

    Help with Quotation Mark.

    I basically try to put a formula in a macro, but the I didn't able to get it to run.
    I use these 2 formulas
    =text(string, "00000"), I put the rept() into the 00000 part.
    =rept(0, 6), and I put the invoiceLenCount part into the 6, So, it makes the length of the output based on user input.

    the formula works without the sub of Rept() part, but after I put in the Rept part, the macros breaks. Please help

    Cells(i, temp1lastCol + 6).Formula = "=text(""" & invoice + i - 2 & """, ""Rept(0, """ & invoiceLenCount & """)"")"
    Thank,

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Help with Quotation Mark.

    Try this one:

    Formula: copy to clipboard
    Cells(i, temp1lastCol + 6).Formula = "=text(" & invoice + i - 2 & ", Rept(0," & invoiceLenCount & "))"
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-21-2014
    Posts
    30

    Re: Help with Quotation Mark.

    Thank for reply, but it is still not working.
    I got error message:
    Run time error '13':
    Type mismatch

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Help with Quotation Mark.

    6SJ's modification works fine for me, e.g.,

    Sub x()
        Dim temp1lastCol As Long
        Dim invoiceLenCount As Long
        Dim invoice     As Long
        Dim i           As Long
    
        temp1lastCol = 1
        invoiceLenCount = 27
        invoice = 42
        i = 2
    
        Cells(i, temp1lastCol + 6).Formula = "=text(" & invoice + i - 2 & ", Rept(0," & invoiceLenCount & "))"
    End Sub
    Are all the varables appropriately declared and initialized?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    05-21-2014
    Posts
    30

    Re: Help with Quotation Mark.

    Thank,
    It works now. And Yes, I mess up one of the Variable declared.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Quotation Mark Problem?
    By rcoope02 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-13-2013, 04:56 PM
  2. Replies: 3
    Last Post: 07-29-2013, 08:55 AM
  3. Quotation mark?
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-09-2008, 10:44 AM
  4. Quotation mark (") conversion
    By jgclickfind in forum Excel General
    Replies: 0
    Last Post: 06-04-2007, 10:52 AM
  5. how do I concatenate text that has a quotation mark
    By sparkroms in forum Excel General
    Replies: 2
    Last Post: 07-08-2005, 05:05 PM

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