B
B
Bartiwka2018-03-31 10:47:45
Visual Basic
Bartiwka, 2018-03-31 10:47:45

How to determine the operating range?

Good afternoon! There is a table in Excel where the time of the beginning and end of the working day is indicated, and between two numbers I must put down the activities for the day. The question itself is how to make sure that the input value (random value) does not go beyond the timeline in the column. Tell me, is it better in the form of a macro or a separate VBA code or a link where it is described.
PS: I only teach Excel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lrv, 2018-04-01
@lrv

The easiest way is to check the cell color. If it is gray then skip it, otherwise enter a value. You write two loops
Do while ActiveSheet.Cells(i,1).value<>“”
Do while ActiveSheet.cells(1,j).value <>“”
And inside if ActiveSheet.cells(i,j).Interior.Color <> RGB(,,) then.
But this will not work quickly, because you are working with a sheet. It will be faster with an array. It's colder there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question