I would like ask this community for assistance.
There are two things I would like to know about related to extracting a date value from a cell:
- A more general aspect
Why does the Range object return a value and the Cells object does not?
Typing Range(“C15”).Value returns a date e.g. 30.01.2024
When I type Cells(3,15).Value it does not return anything.
- My concrete task
I need to use column and row indexes, therefore I should not have letters like letter “C” above, because I need to cycle through cells freely. I wanted to use the Cells object and use column and row indexes to obtain the correct cell and return its value. Consequently, I wanted to use the Workday function to find out whether the date fell on a weekend or not.
Workday(Cells(3,15).Value) always returns 7, presumably because the cells value returned is empty.
Workday(Range(“C15”).Value) returns the correct workday value.
I have always thought these functions are interchangeable.
I thought I could avoid using offsets to make the logic clearer.
Please, could anyone assist?
user25470378 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1