Very Very slow VB code..?????

sezuh

Well-known Member
Joined
Nov 19, 2010
Messages
708
Hi,
Thanks to wonderful,wonderful help from “GlennUK “ solved one part of this tread;
http://www.mrexcel.com/forum/showthread.php?t=535167
but i’m having trouble with one of the Vb Code it’s very very slow,i started on Friday 21.00 pm
by Monday 06.00 it only finished 5883 rows out 20825 only is that normal??? Even after “Glenn” modified the excel formula still very very slow. Would someone please look at the code and give me some idea to sort the code??
I’m using excel 2007 would that be the problem?thanks in advance for any help.
example51_3

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 11pt; FONT-FAMILY: Calibri,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD><TD>F</TD><TD>G</TD><TD>H</TD><TD>I</TD><TD>J</TD><TD>K</TD><TD>L</TD><TD>M</TD><TD>N</TD><TD>O</TD><TD>P</TD><TD>Q</TD><TD>R</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="FONT-SIZE: 10pt">INPUT</TD><TD>Output</TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: right">1</TD><TD style="TEXT-ALIGN: right">2</TD><TD style="TEXT-ALIGN: right">3</TD><TD style="TEXT-ALIGN: right">1 2 3</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">TRUE</TD><TD style="TEXT-ALIGN: right">TRUE</TD><TD style="TEXT-ALIGN: right">0</TD><TD style="TEXT-ALIGN: right">17296</TD><TD style="TEXT-ALIGN: right">6200</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: right">1 2 3</TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: right">1</TD><TD style="TEXT-ALIGN: right">2</TD><TD style="TEXT-ALIGN: right">4</TD><TD style="TEXT-ALIGN: right">1 2 4</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">1</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: right">1 2 4</TD><TD> </TD><TD> </TD><TD>Test cells51</TD><TD> </TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: right">1</TD><TD style="TEXT-ALIGN: right">2</TD><TD style="TEXT-ALIGN: right">5</TD><TD style="TEXT-ALIGN: right">1 2 5</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">2</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">1 2 5</TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: right">3</TD><TD style="TEXT-ALIGN: right">45</TD><TD style="TEXT-ALIGN: right">49</TD><TD> </TD><TD style="TEXT-ALIGN: right">1</TD><TD style="TEXT-ALIGN: right">2</TD><TD style="TEXT-ALIGN: right">6</TD><TD style="TEXT-ALIGN: right">1 2 6</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">3</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: right">1 2 6</TD><TD> </TD><TD> </TD><TD>Output51</TD><TD> </TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: right">1</TD><TD style="TEXT-ALIGN: right">2</TD><TD style="TEXT-ALIGN: right">7</TD><TD style="TEXT-ALIGN: right">1 2 7</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">4</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: right">1 2 7</TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: right">8 19 50</TD><TD> </TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: right">1</TD><TD style="TEXT-ALIGN: right">2</TD><TD style="TEXT-ALIGN: right">8</TD><TD style="TEXT-ALIGN: right">1 2 8</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">FALSE</TD><TD style="TEXT-ALIGN: right">5</TD><TD> </TD><TD> </TD></TR></TBODY></TABLE>
<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=2 border=1><TBODY><TR style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #cacaca"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>L1</TD><TD>=NOT(ISNA(MATCH(H1,$D$4:$F$4,0)))</TD></TR><TR><TD>M1</TD><TD>=NOT(ISNA(MATCH(I1,$D$4:$F$4,0)))</TD></TR><TR><TD>N1</TD><TD>=NOT(ISNA(MATCH(J1,$D$4:$F$4,0)))</TD></TR><TR><TD>O1</TD><TD>=OR(L1:N1)</TD></TR><TR><TD>P1</TD><TD>=COUNTIF($O$1:O1,FALSE)</TD></TR><TR><TD>Q1</TD><TD>=MAX(P1:P20825)</TD></TR><TR><TD>R1</TD><TD>=RANDBETWEEN(1,Q1)</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
Code:
Sub generatecells_51()
    Application.Calculation = xlCalculationManual
    For Each c In Range("A2:A20826")
        myarray = Split(c.Value, " ")
        For i = LBound(myarray) To UBound(myarray)
        [testcells51].Cells(i + 1).Value = Val(myarray(i)): Next
        ActiveSheet.Calculate
        c.Offset(0, 1) = [output51]
    Next
    Application.Calculation = xlCalculationAutomatic
End Sub
Regards
sezuh
 
What exactly do you mean by allocate rows?

Btw - I am currently testing my macro that does a random reorganization of data based on 20,000 datapoints. It has been running for about 10 minutes now and has almost finished (2 points left to find) generating the random set. After that it would be just a simple lookup to reorganize the data, which can still be automated.
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
what i mean is rows from the column "A" ie;
<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 11pt; FONT-FAMILY: Calibri,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>A</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="TEXT-ALIGN: right">1 2 3</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: right">1 2 4</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: right">1 2 5</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">1 2 6</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: right">1 2 7</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: right">1 2 8</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">7</TD><TD style="TEXT-ALIGN: right">1 2 9</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">8</TD><TD style="TEXT-ALIGN: right">1 2 10</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">9</TD><TD style="TEXT-ALIGN: right">1 2 11</TD></TR></TBODY></TABLE>
and down.
thanks
 
Upvote 0
I see, so we need to populate column A and then randomize that column and place the randomization in column B? Or do you already have column A and you simply want to randomly place each value into column B?

Also, I am noticing a potential problem in my random generator. When it gets down to just a few cells left to produce a random number (without repeating) for, it can take a long time for it to find a unique value when looking at a large dataset such as this. Would you be OK with a rule where the last few hundred random generations be simply the ones that haven't been found yet, in order?

For example, say we are generating 100 random numbers, it gets to the 95th one and the values 5, 23, 34, 65, 77, 87 have not been used yet. By this exception, it would simply make 95th = 5, 96th = 23, 97th = 34, 98th = 65, 99th = 77, 100th = 87.

Basically my idea is that I generate a random number 2 through the last row of your data (ie 2 - 20825) and then do a simple index/match using the random number as the row# to grab. This macro will still take a while to run because it is dealing with generating so many random data points, but it will definitely be a lot faster than your other one (I'm estimating this to take approx 10-15 min, but I'll have a better idea how long it will take once I do a full test run on my end).
 
Last edited:
Upvote 0
Hi MRkowz,
i dont think you need to randomize column "A", in column "A" we have the result of combin(51,3) which is 20825 combination.and in column "B"
we are going to use the same combination, but not repeating, and not on the same rows ,and as evenly as possible.
thanks
sezuh
 
Upvote 0
I'm trying to understand what exactly you mean by "as evenly as possible".
 
Upvote 0
hi,
what i mean balanced,using numbers equally.
but only if its possible otherwise do whatever you can on just not repeating, and not on the same rows criteria.
sezuh
 
Upvote 0
Ok, try this out. This code will generate column B with the same data that is populated in column A, without repeating and will not place the same data on the same row.

On my machine, this took approx 10 minutes to run. I have included a statusbar indication to inform you on what phase it is currently running. Phase 2 and 3 will take by far the longest to run.



A few key things to note before running this macro:
  • Data must be present in column A, starting with A2.
  • Columns B and C must be empty for this to run properly
  • Use a worksheet that contains no other formulas to optimize run speed. The more formulas the worksheet has, the slower this will run. You can always copy/paste column B into another worksheet after it is done.
  • This will work on any amount (and any type) of data in Column A, so it can be universally used to generate a random list in column B (without repeating)
  • The last ~2.5% of the data won't be TRULY randomly placed, but will appear to be randomly placed. This is an exception rule I created to handle large amounts of data to dramatically speed up the process.
Please let me know if this does what you require.

Code:
Public Sub RandomSet()
Dim i       As Long, _
    LR      As Long, _
    rng     As Range, _
    cnt     As Long, _
    loopcnt As Long, _
    n       As Long, _
    bool    As Boolean, _
    tStart  As Date, _
    tEnd    As Date
tStart = Now
loopcnt = 1
With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
End With
LR = Range("A" & rows.Count).End(xlUp).row
For i = 2 To LR
   Application.StatusBar = "Phase 1: Currently creating formula on row " & i
   Range("B" & i).Formula = "=Randbetween(2," & LR & ")"
Next i
ActiveSheet.Calculate
Do
    For Each rng In Range("B2:B" & LR).SpecialCells(xlCellTypeFormulas)
       Application.StatusBar = "Phase 2: Checking row " & rng.row & " on loop count " & loopcnt
       If Application.CountIf(Range("B1:B" & LR), rng.Value) = 1 And rng.Value <> rng.row Then
          rng.Value = rng.Value
          cnt = cnt + 1
       End If
    Next rng
    ActiveSheet.Calculate
    loopcnt = loopcnt + 1
Loop While cnt < LR - (LR * 0.025)
n = 2
For Each rng In Range("B2:B" & LR).SpecialCells(xlCellTypeFormulas)
    For i = n To LR
        Application.StatusBar = "Phase 3: Currently checking row " & rng.row & " for value " & i
        If Application.CountIf(Range("B2:B" & LR), i) = 0 And i <> rng.row Then
            rng.Value = i
            If bool Then n = 1 Else n = i
            Exit For
        ElseIf Application.CountIf(Range("B2:B" & LR), i) = 0 And i = rng.row Then
            bool = True
        End If
    Next i
    bool = False
Next rng
For Each rng In Range("B2:B" & LR)
    Application.StatusBar = "Phase 4: Currently placing randomization on row " & rng.row
    rng.Offset(0, 1).Value = Range("A" & rng.Value)
Next rng
Columns(3).Copy Destination:=Columns(2)
Columns(3).ClearContents
tEnd = Now
With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
    .StatusBar = False
End With
MsgBox "Time started: " & tStart & " -- Time Ended: " & tEnd
End Sub
 
Last edited:
Upvote 0
There is one very very small possible error in my code that is fixed in the below code (which is heavily commented for future reference in case anyone else needs a macro similar to this).

Code:
'MrKowz: [URL]http://www.mrexcel.com/forum/showthread.php?t=536229[/URL]
'Use data in Column A to create a randomly rearranged list in Column B.
'Note:
'   **Data must be present in column A, starting with A2.
'   **Columns B and C must be empty for this to run properly
'   **Use a worksheet that contains no other formulas to optimize run speed.
'       The more formulas the worksheet has, the slower this will run. You can
'       always copy/paste column B into another worksheet after it is done.
'   **This will work on any amount (and any type) of data in Column A, so it can
'       be universally used to generate a random list in column B (without repeating)
'   **The last ~2.5% of the data won't be TRULY randomly placed, but will appear
'       to be randomly placed. This is an exception rule I created to handle large
'       amounts of data to dramatically speed up the process.
Public Sub RandomSet()
Dim i       As Long, _
    LR      As Long, _
    rng     As Range, _
    cnt     As Long, _
    loopcnt As Long, _
    n       As Long, _
    bool    As Boolean, _
    tStart  As Date, _
    tEnd    As Date
 
'******************************** Initialization *********************************
'* Define initial variables and disable ScreenUpdating and Automatic Calculation *
'*********************************************************************************
tStart = Now
loopcnt = 1
With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
End With
LR = Range("A" & rows.Count).End(xlUp).row
 
'************************************ Phase 1 ************************************
'* Populate column B with a randbetween formula used to generate an index number *
'*********************************************************************************
For i = 2 To LR
   Application.StatusBar = "Phase 1: Currently creating formula on row " & i
   Range("B" & i).Formula = "=Randbetween(2," & LR & ")"
Next i
ActiveSheet.Calculate
 
'************************************ Phase 2 ************************************
'*   Loop to determine if value in column B is unique.  Will only check cells    *
'*   that have not yet found a unique index.  Will continue to loop until        *
'*   97.5% of the data has a unique index.                                       *
'*********************************************************************************
Do
    For Each rng In Range("B2:B" & LR).SpecialCells(xlCellTypeFormulas)
       Application.StatusBar = "Phase 2: Checking row " & rng.row & " on loop count " & loopcnt
       If Application.CountIf(Range("B1:B" & LR), rng.Value) = 1 And rng.Value <> rng.row Then
          rng.Value = rng.Value
          cnt = cnt + 1
       End If
    Next rng
    ActiveSheet.Calculate
    loopcnt = loopcnt + 1
Loop While cnt < LR - (LR * 0.025)
 
'************************************ Phase 3 ************************************
'*    The last 2.5% of the data that has not yet found a unique index will be    *
'*    directly assigned a non-random unique index.                               *
'*********************************************************************************
n = 2
For Each rng In Range("B2:B" & LR).SpecialCells(xlCellTypeFormulas)
    For i = n To LR
        Application.StatusBar = "Phase 3: Currently checking row " & rng.row & " for value " & i
        If Application.CountIf(Range("B2:B" & LR), i) = 0 And i <> rng.row Then
            rng.Value = i
            If bool Then n = 2 Else n = i
            Exit For
        ElseIf Application.CountIf(Range("B2:B" & LR), i) = 0 And i = rng.row Then
            bool = True
        End If
    Next i
    bool = False
Next rng
 
'************************************ Phase 4 ************************************
'*              Uses random index numbers to populate the new list               *
'*********************************************************************************
For Each rng In Range("B2:B" & LR)
    Application.StatusBar = "Phase 4: Currently placing randomization on row " & rng.row
    rng.Offset(0, 1).Value = Range("A" & rng.Value)
Next rng
 
'************************************ Cleanup ************************************
'*  Reorganizes data and turns ScreenUpdating and Automatic Calculation back on  *
'*********************************************************************************
Columns(3).Copy Destination:=Columns(2)
Columns(3).ClearContents
tEnd = Now
With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
    .StatusBar = False
End With
MsgBox "Time started: " & tStart & " -- Time Ended: " & tEnd
End Sub
 
Upvote 0
hi Mrkows,
that is very fast but unfortunetaly there is alot of repeat here just some of them;
Sheet1


<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 11pt; FONT-FAMILY: Calibri,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>D</TD><TD>E</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD>6 39 45</TD><TD>1 35 39</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: right">1 2 6</TD><TD style="TEXT-ALIGN: right">1 6 30</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: right">1 2 4</TD><TD style="TEXT-ALIGN: right">4 11 15</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">1 2 19</TD><TD>2 39 49</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: right">1 5 39</TD><TD style="TEXT-ALIGN: right">1 9 15</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: right">1 7 38</TD><TD style="TEXT-ALIGN: right">7 17 28</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">7</TD><TD style="TEXT-ALIGN: right">1 26 35</TD><TD>1 35 40</TD></TR></TBODY></TABLE>
if the d1 has 35 in e1 should not,d2 its got 1 and 6 e2 shouldnot have those numbers
thanks
sezuh


Excel tables to the web >> <a style ="font-family:Arial; font-size:9pt; color:#fcf507; background-color:#800040; font-weight:bold;" href="
but definetely in the right direction
sezuh
 
Last edited:
Upvote 0
Now I see what you meant by repeat, I had thought you meant not repeating the entire string. This will take quite a bit more coding to accomplish, and unfortunately I don't quite have the time for it today. I'll see what I can come up with tomorrow and hopefully come up with a decent solution.
 
Upvote 0

Forum statistics

Threads
1,225,155
Messages
6,183,214
Members
453,151
Latest member
Lizamaison

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