+ Reply to Thread
Results 1 to 7 of 7

Fill data in label format (Run time Error 1004)

Hybrid View

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Fill data in label format (Run time Error 1004)

    Hi.

    By running a code, an error, can anyone help me fix this error appears?

    Thanks
    Attached Files Attached Files
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Fill data in label format (Run time Error 1004)

    You have mistyped your named range "SETIQUETAa9", which applies to teste!$T$16. It should be "SETIQUETA9" for your loop of i values to reference it correctly. You are also missing a named range "SETIQUETA55" (should this point at teste!$Z$124 ?)

    I'm also not convinced that this range is correctly defined:
    Set rng = Sheet5.Range("AF3", Sheet5.Range("N65536").End(xlUp))
    Which seems to be causing your loop to exceed the number of named ranges...

    I'm afraid I don't understand your requirement well enough to advise what you actually want that range to be!
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Fill data in label format (Run time Error 1004)

    Hi.
    I'm trying to populate the table (AF3: AH7) within the tags ("Empresa")

    Thanks

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Fill data in label format (Run time Error 1004)

    Hi i'm solved!
    
    Sub Look()
        Dim sQde
        Dim sCod
        Dim i As Long
        Dim x As Long
        Dim rng, sEtiqueta As Range
        Dim sQdeTT As Double
    
        Set rng = Sheet5.Range("AF3", Sheet5.Range("AF65536").End(xlUp))
        
        x = 1
        
        For Each sCod In rng
            
            sQde = sCod(1, 5).Value
            
            sQdeTT = sQdeTT + sQde
            
            For i = x To sQdeTT
              Range("sEtiqueta" & i).Value = sCod
              Range("sEtiqueta" & i).Offset(1, 0).Value = sCod(1, 3).Value
                
                x = x + 1
                
            Next i
        
        Next sCod
        
    End Sub
    Thanks

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Fill data in label format (Run time Error 1004)

    Glad you figured it out. Thanks for letting us know.

    Hope you fixed those named range issues, too

  6. #6
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Fill data in label format (Run time Error 1004)

    Hi. Olly

    thanks for the tips

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Fill data in label format (Run time Error 1004)

    Quote Originally Posted by marreco View Post
    Hi. Olly

    thanks for the tips
    My pleasure, glad it was some help Thanks for the feedback.

+ 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] Run Time Error 1004 when copying data
    By Sharksfan88 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-08-2012, 06:45 AM
  2. Run time error 1004 - Data refreshing in background
    By crowby1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2012, 08:16 AM
  3. Run-Time Error 1004 when changing cell fill to None via macro
    By Gara in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-21-2012, 02:53 PM
  4. Run-time Error 1004 with Data Validation
    By RagonichaFulva in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2012, 07:47 AM
  5. Sorting data 'Run-time error '1004'
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2011, 09:52 AM

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