Results 1 to 3 of 3

Thread: Insert 36 string to cell?

  1. #1

    Insert 36 string to cell?



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi all,

    I have this 36 list.
    How to insert it in cell from range A3 to A38 when i press the button?
    I try code example below, but it didt work. I think it is wrong plus i'm still new in vba.

    Code:
    Sub test()Dim month As Variant
    
    
    month = Array("Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dis")
    Worksheets("Sheet1").Range("C7:N7").Value = month
    
    
    
    End Sub


    BAR
    BEE
    BEI
    BEM
    BSG
    CTM
    CTO
    CTS
    DEG
    EBK
    ECT
    FEE
    FEI
    FEM
    FGA
    FVI
    IPR
    LGS
    NOX
    NTM
    OBA
    OTH
    PDR
    PKG
    PLA
    PLM
    PSG
    RCV
    REL
    RPR
    RTX
    SAR
    SED
    SFT
    SMK
    SMT

    Thanks!

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,398
    Articles
    0
    Excel Version
    365
    Code:
    List36 = Array("BAR", "BEE", "BEI", "BEM", "BSG", "CTM", "CTO", "CTS", "DEG", "EBK", "ECT", "FEE", "FEI", "FEM", "FGA", "FVI", "IPR", "LGS", "NOX", "NTM", "OBA", "OTH", "PDR", "PKG", "PLA", "PLM", "PSG", "RCV", "REL", "RPR", "RTX", "SAR", "SED", "SFT", "SMK", "SMT")
    Range("A3:A38").Value = Application.Transpose(List36)
    
    'or if the list size varies:
    'Range("A3").Resize(UBound(List36) + 1).Value = Application.Transpose(List36)

  3. #3
    Conjurer snb's Avatar
    Join Date
    May 2013
    Posts
    371
    Articles
    0
    Excel Version
    2020
    Code:
    sheet1.range("C7:N7")= Application.GetCustomListContents(3)
    sheet1.range("C8:N8")= Application.GetCustomListContents(4)
    
    
    sn=split("BAR,BEE,BEI,BEM,BSG,CTM,CTO,CTS,DEG,EBK,ECT,FEE,FEI,FEM,FGA,FVI,IPR,LGS,NOX,NTM,OBA,OTH,PDR,PKG,PLA,PLM,PSG,RCV,REL,RPR,RTX,SAR,SED,SFT,SMK,SMT",",")
    cells(3,1).resize(ubound(sn)+1)=application.transpose(sn)

Tags for this Thread

Posting Permissions

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