find last row used and then get text from cells in row 1 throught to last used in a string

tony.reynolds

Board Regular
Joined
Jul 8, 2010
Messages
97
im new here but if someone can help it would be appreciated.

Working on an "Orders" Workbook

I have 3 columns of data on 10 rows i want to get text from

A = QTY
B = Description
C = Partnumber

what i need to do is end up with the
partnumber1 then a comma then the qty1 then a new line
partnumber2 then a comma then the qty2 .. so on until the last row used.

if you can imagine i have PART1, PART2 and so on down my spreadsheet then in qty column i have QTY1, QTY2...

the data in this text format

partnumber1,qty1
partnumber2,qty2
partnumber3,qty3
partnumber4,qty4

this needs to be on the clip board for pasting ctrl V into a order page on a website

To test it i paste into a text file

so far i have a code that places the result in cel D1 but is as far as my green brain can take it..

Sub RS()

RSData = Range("C1").Text & "," & Range("A1").Text & Chr(10) & Range("C2") & "," & Range("A2")

Range("D1") = RSData

End Sub
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try this:
Code:
Sub RS()
For r = 1 To 10
RSData = Cells(r, 3).Text & "," & Cells(r, 1).Text
Cells(r, 4) = RSData
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

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