Q:

Excel VBA multiply multiple rows each by their own number

I am trying to find the best way to multiply a row of data by a variable.  I have a table like this:

I have a script that asks me to enter the number of the days the analyst worked during that time period.
What I want to have happen next, is another table with the same header and formatting be filled in with the above data divided by the days worked.   I.E. let's say the first row under Staff Time, 24:54:55 divided by 3 days worked, so 8 hours and change.
I want this to all be in the code, as opposed to functions in the excel sheet.
I tried using a function like:
Dim rng As Range
For Each rng In Range("G54:R54")
    rng = (rng / wd1)
Next rng

But that did not work.  Any ideas?

A:

What is wd1? Did you declare it? If not, it is zero, hence a divide by zero error.
Otherwise code is fine & works on my computer.
Use option explicit to avoid such mistakes.
Edited: calculating for example 380*1000/60  does raise an error because all those are assumed to be integers. Maybe it can be related, try using cdbl(rng)

