• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Negative Variable in .OFFSET

PaulF

Active Member
Dest.Range(ddatecell & z).Value = Source.Range(scell & rowcnt).Offset(-1, y)

^^ Works

Dest.Range(ddatecell & z).Value = Source.Range(scell & rowcnt).Offset(-y, y)

^^ Will not work and I can't figure out why or a solution :-(

Any help would be greatly appreciated...

Respectfully,
PaulF
 
Hi ,

It entirely depends on the values of the different variables , such as rowcnt , y.

When you use a negative offset for the row , you are going up , towards row 1.

When you use a negative offset for a column , you are going left , towards column A.

In either case , if you overshoot , and end up with either a zero or negative row , or a column to the left of column A , Excel will generate an error.

Narayan
 
Back
Top