Cells(2, Columns.Count).End(1)(1, 2).Value = n |/| difficult to manipulate "for me"

montecarlo2012

Well-known Member
Joined
Jan 26, 2011
Messages
984
Office Version
  1. 2010
Platform
  1. Windows
Hello everyone.
I think I don't need for this question to use XL2BB, if so, please let me know will more than grateful to do it.
with this code:
VBA Code:
Sub jumping_v2()
  Dim i As Long, n As Long
  Dim f As Range  
  For i = 2 To Range("B" & Rows.Count).End(3).Row  
    Set f = Range("B" & i).Resize(, 5).Find(1, , xlValues, xlWhole)   
    If Not f Is Nothing Then    
      Cells(2, Columns.Count).End(1)(1, 2).Value = n     
      n = -1
    End If
    n = n + 1
  Next
End Sub
I got this answer:
1682438633895.png

right beside my array is the answer, I really need my answer on T2
so I tried to change the line for:
VBA Code:
Sub jumping_v2()
  Dim i As Long, n As Long
  Dim f As Range
  
  For i = 2 To Range("B" & Rows.Count).End(3).Row
  
    Set f = Range("B" & i).Resize(, 5).Find(1, , xlValues, xlWhole)
   
    If Not f Is Nothing Then
    
            Cells(Rows.Count, "P").End(xlUp).Offset(1, 0).Value = n
      

      n = -1
    End If
    n = n + 1
  Next
End Sub
and this is what I got:
1682438797507.png

so what I am looking for is for:

1682438907227.png


dante_skip_April.xls
BCDEF
254232532
347133133
41012172633
5510193336
61013162127
778102429
8812202728
919153133
10511212528
1125132527
12912303236
13312192231
Sheet1

thank you for your understanding and time
 
I do not know where to start.

You have several problems that you need to solve.

I make a list for you to solve them:
1.
In your profile you say that you have excel 2010, but you uploaded a 2003 version file. Correct your profile.
2. The 2003 version only has 256 columns, that is, the number 5 is repeated 1255 times, that's why it doesn't fit in 256 columns, that's why I put the sequence in other rows.
3. Update your excel file to version 2010, that way you will have more than 256 columns.
4. I don't understand what you are looking for or what you need as a result.
5. Explain with another file what you need, use colors to explain how you want the result, do not just send a file without explanations, it is very difficult to understand what result you want just by putting an image.
6. So explain each output sequence that you need.

7. You put this:
Set f = Range("B" & i).Resize(, 5).Find(1, , xlValues, xlWhole) display T2
For me to understand what you want, you need to put source data and what result you want.
8. You put this:
Set f = Range("B" & i).Resize(, 5).Find(2, , xlValues, xlWhole) display T3
For me to understand what you want, you need to put source data and what result you want.
9. You put this:
Set f = Range("B" & i).Resize(, 5).Find(3, , xlValues, xlWhole) display T4
For me to understand what you want, you need to put source data and what result you want.

10. I understand that you want a loop, but to solve it you must explain with several examples what you want as a result.
11. Close this thread because the original request was this:
so what I am looking for is for:

1682438907227.png

12. Create a new thread with all the recommendations that I put above and of course with a file that contains all the explanations. :)

--------------
Respectfully
Dante Amor
--------------
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
sorry about everything, and thank you for your help,
your points are right
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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