Hello all!
I need a VBA Code to solve my problem as attachments.
Please see the file.
thank you!
Note: If Column B has a value of 0 is not paired
Hello all!
I need a VBA Code to solve my problem as attachments.
Please see the file.
thank you!
Note: If Column B has a value of 0 is not paired
Try:-
Regards Mick![]()
Sub MG31Jan46 Dim Rng As Range, Dn As Range, Stg As String Set Rng = Range(Range("A2"), Range("A" & Rows.Count).End(xlUp)) For Each Dn In Rng If Not Dn.Offset(, 1) = 0 Then Stg = Stg & Dn.Value & ":" & Dn.Offset(, 1).Value & "Kg" & ", " End If Next Dn Range("I1").Value = Stg End Sub
Hi,
Enter this to C2, and copy it down. Then select C16, copy it and paste it back as a value.
Formula:![]()
=C1&A2&":"&B2&"kg"
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Hi,
To avoid the zero use this modified formula in C2 copied down.
Formula:
=H1&A2&":"&IF(B2=0,"",B2)&"kg, "
Try this:-
Regards Mick![]()
Sub MG31Jan15 Dim Rng As Range, Dn As Range, Stg As String Set Rng = Range(Range("A2"), Range("A" & Rows.Count).End(xlUp)) For Each Dn In Rng If Not Dn.Offset(, 1) = 0 Then Stg = Stg & ", " & Dn.Value & ":" & Dn.Offset(, 1).Value & "Kg" End If Next Dn Range("I1").Value = Mid(Stg, 3) End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks