P
P
Pavel2021-03-10 10:39:53
Visual Basic
Pavel, 2021-03-10 10:39:53

How to attach not to a column by number, but by “value” in Excel?

I made a couple of scripts for the convenience of using the document, but I'm not the only one working in the document, and often there is an orgy there: columns are moved, added, etc.

I contact by:

Sub Hide()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In ActiveSheet.UsedRange.Columns(5).Cells
If cell.Value = "нет" Then cell.EntireRow.Hidden = True
Next
Application.ScreenUpdating = True
End Sub
Columns(5)

And here, for example, another piece of code
Sheets("Лист 1").Cells(1 + Offset1, 1 + Offset2).Value = Sheets("Лист 2").Cells(i, 18)

Here the last parameter 18 is the column number.

How to get away from the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Korben5E, 2021-03-10
@mrusklon

name a cell and address already by name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question