Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 33

Thread: Special concatenation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    14
    Or:

    Code:
    Sub M_snb()
      Sheet1.UsedRange.Columns(4).NumberFormat = "0.00"
      Sheet1.UsedRange.Offset(1).Copy
      
      With GetObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
        .GetFromClipboard
        sn = Split(Replace(Replace(.gettext, vbTab, """;"""), vbCr, """" & vbCr), vbCrLf)
        
        For j = 0 To UBound(sn)
          sn(j) = Replace(sn(j), """", "", , 1)
        Next
      End With
    
      Sheet2.Cells(1).Resize(UBound(sn) + 1) = Application.Transpose(sn)
    End Sub

  2. #2
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    14
    I do not understand why you use 'Let'. The use of it has become redundant for more than 20 years.

    To 'walk' in your approach:

    Code:
    Sub M_snb()
       sn = Sheet1.Cells(1).CurrentRegion
       
       For j = 2 To UBound(sn)
         For jj = 1 To UBound(sn, 2)
           c00 = c00 & IIf(jj = 1, sn(j, jj) & ";", """" & IIf(jj = 4, Format(sn(j, jj), "0.00"), sn(j, jj)) & """;")
         Next
         c00 = c00 & vbLf
       Next
       
       MsgBox Replace(c00, ";" & vbLf, vbLf)
    End Sub
    or

    Code:
    Sub M_snb_002()
       sn = Sheet1.Cells(1).CurrentRegion
       
       For j = 2 To UBound(sn)
        c00 = c00 & """" & vbLf & Replace(Join(Application.Index(sn, j), """;"""), """", "", , 1)
       Next
       
       MsgBox Replace(Mid(c00, 3), """0""", """0,00""")
    End Sub
    Last edited by snb; 08-31-2015 at 08:02 PM.

  3. #3
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hi
    . 1 )
    Quote Originally Posted by snb View Post
    I do not understand why you use 'Let'. The use of it has become redundant for more than 20 years……
    . 1 a) Up until about 2 years ago, the last time I had the slightest thing at all to do with Computers was about 25 years ago. My first experience at all with a pc or “Windows” things was 2 years ago .

    . 1 b) While learning VBA ( or rather OOP ) it helps me distinguish between, ( and the reasons for ) things that can be Let , things that must be Set and things that must have neither.

    Quote Originally Posted by snb View Post
    …..
    To 'walk' in your approach:.....
    ..
    Thanks very much for that. I intend to go through that in some detail when I have the time to do it justice, and I expect learn much from it. ( But whether I will really get to grasp the how VBA is seeing its evaluate strings and quotes etc..... I am not sure if anyone really knows, like i am finding to my surprise with most things to do with software, especially Excel VBA these days!!. Maybe I will be surprised when I work through what you have kindly given.. )

    Thanks again
    Alan
    Last edited by DocAElstein; 08-31-2015 at 08:22 PM.

  4. #4
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    14
    @Doc

    If you prefer we can communicate in your native tongue if we exchange views on Excellösung.

  5. #5
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Quote Originally Posted by snb View Post
    .....
    If you prefer we can communicate in your native tongue if we exchange views on Excellösung.
    Waren sie schon da..
    Bzw. Hier
    http://www.office-loesung.de

    mir scheint als ob kein anderer Mensch war, seit Jahren,
    es war aber nur eine schnell “Google”
    evtl. haben sie wo oder was anderes gemeint?

  6. #6

  7. #7
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Quote Originally Posted by snb View Post
    ich habe keine Ahnung was da soll ist / ist …. Ich komme Lieder nicht mit, stehe auf die Leiter denk ich…was sol ,dann das ….. Aktuelles Datum und Uhrzeit: 03. Mai 2014, 13:06

    scheinbar ist das Forum Zeit lange abgestellt / Zu / geschlossen, Tote Hosen ??




    oder meinen sie das:
    http://www.office-loesung.de/p/
    Attached Images Attached Images
    Last edited by DocAElstein; 09-01-2015 at 01:32 AM.

  8. #8

  9. #9
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    hat schon bemerkt, Danke.

  10. #10
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    14
    @Alan

    Your posts are increasingly unreadable.

    If you are interested in 'Evaluate' have a look at:

    VBA for smarties How to fill a Combobox / Listbox

Similar Threads

  1. Flexible Concatenation Function
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 23
    Last Post: 05-11-2019, 08:22 PM
  2. copy special cells with values and formats
    By rodich in forum Excel Help
    Replies: 1
    Last Post: 10-25-2013, 03:55 PM
  3. To Paste special by value
    By ravichandavar in forum Excel Help
    Replies: 7
    Last Post: 08-13-2013, 12:23 PM
  4. FORMATTED Flexible Concatenation Function
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 1
    Last Post: 10-14-2012, 03:48 PM
  5. Remove Special Characters :
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 3
    Last Post: 03-06-2012, 09:41 PM

Posting Permissions

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