VBA: Concat loop with Formatting

NetFlash

New Member
Joined
Jul 26, 2011
Messages
14
Hi, i'm looking for a solution to the following.
I have a table like this:
<table border="0" cellpadding="0" cellspacing="0" width="128"><colgroup><col style="width:48pt" width="64"> <col style="width:48pt" width="64"> </colgroup><tbody><tr style="height:12.75pt" height="17"> <td class="xl24" style="height:12.75pt;width:48pt" height="17" width="64">Weight</td> <td class="xl25" style="width:48pt" width="64">Index</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl26" style="height:12.75pt" align="right" height="17">200</td> <td class="xl27" align="right">0.16</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" align="right" height="17">1000</td> <td class="xl28" align="right">0.19</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" align="right" height="17">2000</td> <td class="xl28" align="right">0.44</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" align="right" height="17">3000</td> <td class="xl28" align="right">0.74</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" align="right" height="17">4000</td> <td class="xl28" align="right">1.10</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" align="right" height="17">5000</td> <td class="xl28" align="right">1.15</td> </tr> </tbody></table>
And wish to create an output string to put in a single cell (F3) that looks like this:
1/Code/INS/200/0.16*1000/0.19*2000/0.44*3000/0.74*4000/1.10*5000/1.15

The entry starts with: 1/Code/INS
The values from one row are concated with: /
The values of the multiple rows are concated with: *

As i'm new to VBA i can't quite get a working code.
Any and all help is appreciated
 
I do not think it is possible to to what you describe using basic VB, although someone else may know differently.
By adding this extra post to the bottom of your original thread , you are rather limiting you replies.
It may be better if you started a new thread.
Regards Mick
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
If you placed a textbox in the sheet you could do this:-
Which would give you the length of the selected text.
Code:
Private Sub TextBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
MsgBox Len(TextBox1.SelText)
End Sub
Mick
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,799
Members
452,943
Latest member
Newbie4296

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