Create a range from data captured and store in variable to be referred to without push the data into cells

Shodi

Board Regular
Joined
May 24, 2016
Messages
53
Hi Everyone,

I have data that is captured (by input from the user) like given below - the data in quotes is the data captured. I am labeling them here for easy reference.

Data 1 captured in Cell A1- Size 1|Size 2|Size 3
Data 2 captured in Cell B1- AItem 1|AItem 2|AItem 3|AItem 4|AItem 5
Data 3 captured in Cell C1- BItem 1|BItem 2|BItem 3
Data 4 captured in Cell D1- CItem 1|CItem 2|CItem 3|CItem 4

The data is captured in exactly the same format as given above - using the vertical bar as separator and no spaces before or after the separator.

Once this data is captured the user will be shown a Userform with "Data 1" as column headers and "Data 1" or "Data 2" or "Data 3" (depending on the column that is active) as the row headers and with corresponding blank TextBoxes where the user needs to fill in the respective prices - am attaching a screenshot of the Userform that the user will see.
Once the user fills out the prices the data from the UserForm then needs to be Captured in the Corresponding row in Column E in exactly the below-given format
(have used "*" as a filler character for "prices" as I did not want it to be confused with the Size number.

"Item 1=Size 1-*,Size 2-*,Size 3-*+Item 2=Size 1-*,Size 2-*,Size 3-*+Item 3=Size 1-*,Size 2-*,Size 3-*+Item 4=Size 1-*,Size 2-*,Size 3-*+Item 5=Size 1-*,Size 2-*,Size 3-*"

Currently, I am using "texttocolumns", "transpose" and copy and paste to get this done in VBA.
The blanked out data in the attached image (i.e the "Sizes" horizontally and "Items" vertically are right now being sourced from cells out of the user's sight, from Column BC where they have been pushed to after the "texttocolumns" and "transpose" functions.

Is there a more efficient way to do this?
 

Attachments

  • Userform Image.JPG
    Userform Image.JPG
    29.5 KB · Views: 12

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Sorry missed out on adding the quotes.

Data 1 captured in Cell A1- "Size 1|Size 2|Size 3"
Data 2 captured in Cell B1- "AItem 1|AItem 2|AItem 3|AItem 4|AItem 5"
Data 3 captured in Cell C1- "BItem 1|BItem 2|BItem 3"
Data 4 captured in Cell D1- "CItem 1|CItem 2|CItem 3|CItem 4"
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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