Hello-
New to VBA after having just finished an introductory text. Thanks for your help in advance!
I am trying to do something that I thought would be pretty simple- set a variable equal to a cell in a spreadsheet.
the line of code that is giving me trouble is:
payrate = Worksheets("sheet1").Cells(payrow, paycolumn)
The values for payrow and paycolumn are determined elsewhere in the program. For example, if payrow is determined to be 1 and paycolumn is determined to be 10, I want payrate to be equal to the value in the cell at 1,10 (row 1 column 10) in sheet 1.
When the debug function is running, I hover my mouse cursor over payrow and paycolumn and the values in those variables are correct, but hovering over payrate shows a value of 0. The error I am getting is "run time error 1004, application defined or object defined error"
What am I doing wrong? Thanks for your time.
Bookmarks