ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating table from cell contents (https://www.excelbanter.com/excel-programming/321476-creating-table-cell-contents.html)

Foss

Creating table from cell contents
 
Mornin' all,

I've got a table with company details on it, then a list
of product codes that the company sells.
I want to write a new table, for the moment just a new
worksheet would be great, based on the product codes.

I'd like to take a record like this (where the ' - ' bit
specifies a new column):
R1FQ33 - 20780P,41930P
and turn it into this:
R1FQ33 - 20780 - P
R1FQ33 - 41930 - P

Has anyone done something along these lines before? If so,
can you help me get started plese?

Thanks very much,
Foss

tina

Creating table from cell contents
 
Hi
I would write something like this
For Each cell In Range("mydata")
cell.Copy
Range("new").Select
ActiveSheet.Paste
ActiveCell.Offset(0, 1) = "=mid(vlookup(rc[-1],myrange,2,false),1,5)"
ActiveCell.Offset(0, 2) = "=mid(vlookup(rc[-2],myrange,2,false),6,1)"
ActiveCell.Offset(1, 1) = "=mid(vlookup(rc[-1],myrange,2,false),8,5)"
ActiveCell.Offset(1, 2) = "=mid(vlookup(rc[-2],myrange,2,false),13,1)"
ActiveCell.Offset(2, 0).Range("a1:a2").Name = "new"
Next cell

where mydata is range of data with R1FQ33
and myrange is range of all data
and new is 2 rows where new data is required
hope this helps

"Foss" wrote:

Mornin' all,

I've got a table with company details on it, then a list
of product codes that the company sells.
I want to write a new table, for the moment just a new
worksheet would be great, based on the product codes.

I'd like to take a record like this (where the ' - ' bit
specifies a new column):
R1FQ33 - 20780P,41930P
and turn it into this:
R1FQ33 - 20780 - P
R1FQ33 - 41930 - P

Has anyone done something along these lines before? If so,
can you help me get started plese?

Thanks very much,
Foss



All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com