14 réponses
Hello,
Coding for fun, I would like to understand what you want to do.
Assumptions:
A): You want each name to have its own incremented list.
B): You want to increment from a specific name (what happens to the previous names?).
What is the ultimate goal? (try to describe it without thinking in "Excel" logic).
Show a spreadsheet as you would like it in the end.
Here are macros that I found on CCM but which are not suitable for my example
Sub NumeroteLigneVisible() Dim i As Long, DerLig As Long, P As Long Sheets("Sheet2").Select DerLig = Range("A1").SpecialCells(xlCellTypeLastCell).Row 'Number the H column (8) P = 1 For i = 1 To DerLig If CelR.Rows(i).Hidden = False Then Cells(i, 8) = P P = P + 1 End If Next i End Sub or this macro Sub NumFacture() ' select the range to number before calling the macro Dim c As Range, num As Long num = CLng(InputBox("First invoice number?", "Automatic numbering of the selected range")) For Each c In Selection If c.EntireRow.Hidden = False Then c.Value = num num = num + 1 End If Next c End Sub
I found this VBA on CCM from a question asked in 2008.
Excel: Incrementing hidden cells
Resolved/Closed
Hello Rom27_52
I still don't understand what you're trying to achieve because you haven't provided any examples of the desired result in your file.
We should review this if you want a response through a formula.
As for VBA, I don't know anything about it and I really don't understand it, so I'll leave it to the specialists to respond to you.
Best regards
I created an Excel file where I filter certain rows, and I would like to be able to enter a number that increments only on the visible cells.
Is this possible? I can't find a solution, and I have to do the incrementing manually, which takes a long time.
https://www.cjoint.com/c/NCehh4fDHqm
Thank you for your help
If you're on Windows, I can create a dedicated software for you (free, open source, and no installation required). I sent you a private message (red circle at the top right of the page).
I'm putting it here for 14 days
To delete, it's in the "données.txt" file
No spaces in names
Double click on: "sp.exe"
Input format: Name spX
It's here--->: https://www.mediafire.com/file/pks85abt50wlaa9/seances.zip/file
Thank you Daniel,
But this is not the solution I am looking for.
What I am looking for is to be able to increment - to pull down - according to the "Name" and "code" sort, but it is the rows hidden by the sort/filter that cause problems for this incremental copy.
https://www.cjoint.com/c/NCehh4fDHqm
Hello Rom27_52
Still the same file without additional explanations about what you're trying to do, you know what you want but you describe nothing.
Increment - copy what and how.
What is the relationship between the table on the left and the table on the right ??
In the absence of clear, concise, and precise indications, this will be my last intervention on this subject.
Best regards
It is evident that what Rom wants is an update of the states (incrementing with "forgetting" the previous states).
I am waiting for the feedback on the software that I gave him, which will confirm or refute my assertion.
The same with totals by sp.
Link 14 days (Windows only)--->: https://www.mediafire.com/file/bg70j2n1gkmkfy9/seaces.zip/file

Hello,
I have several names in my table, each assigned 3 codes (sp1, sp2, sp3).
Each person (name) has completed several sessions (sp1, sp2, sp3), e.g.
Person A: 3 sp1 sessions followed by 4 sp2 sessions, ...
People B, C, etc. are the same: Number of sessions to be recorded in the table.
When I apply the filter on person A, I would like to increment the number of sessions by copying them into the table column: this works with the COUNTIFS formula, but only if we start from the number 1 (i.e., session no. 1).
If person A (whom I select by applying the filter on person A among all the other people in the table) has already attended 6 sessions, and I want to increment the following sessions (7, 8, 9, 10, etc.) by copying them into the table column,
the incrementation does not work by copying; I assume that Excel also counts the values of the hidden cells? in the table.
I hope I am clearer regarding my question. :-)
Thank you very much for your help.
https://www.cjoint.com/c/NCehh4fDHqm
Here is the example attached.