Recurring String Generator

dlo1503

New Member
Joined
Feb 24, 2020
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Hello

I am currently writing a code to generate labels from a spreadsheet of data. At the minute the various strings are made up from cells in Row 2 on Sheet1. I would like this to continue down until the last row of text in Column B. The output looks like I want it to however I would like it to generate output for each row in column B on Sheet 1 to each row in Column A on Sheet2.

Sub Concatenate2()

Dim String1 As String
Dim String2 As String
Dim String3 As String
Dim String4 As String
Dim String5 As String
Dim String 6 As String

Dim full_string As String

String1 = Sheet1.Cells(2, 20).Value
String2 = Sheet1.Cells(2, 2).Value
String3 = Sheet1.Cells(2, 4).Value
String4 = Sheet1.Cells(2, 6).Value
String5 = Sheet1.Cells(2, 5).Value
String6 = Sheet1.Cells(2, 15).Value

Sheet2.Cells(1, 1).Value = String1 & vbNewLine & vbNewLine & String2 & vbNewLine & "QTY- " & String3 & vbNewLine & String4 & "mm " & String5 & vbNewLine & String6

End Sub


Any help greatly appreciated

thanks
Daniel
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top