Simple VBA: Set Value of Specific Cell

Bill Bisco

Active Member
Joined
Aug 8, 2007
Messages
446
Dear all,

I know that this should be simple but I am getting object not defined errors. Any help would be appreciated.

I can't get any of the following to work
Code:
Sheets("Scorecard").Range(Cells(25, 3)).Value = "Architecture / Derivative 1"
Sheets("Scorecard").Range(25, 3).Value = "Architecture / Derivative 1"
Sheets("Scorecard").Cells(25, 3).Value = "Architecture / Derivative 1"
Worksheets("Scorecard").Range(Sheets("Scorecard").Cells(25, 3)).Value = "Architecture / Derivative 1"

What am I doing wrong?
 
Last edited:

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
What cell are you trying to set the value of and what value are you trying to set it to?

In the posted code the only line I'm sure will work is this and it'll put 'Architecture / Derivative 1' in C25 on the sheet 'Scorecard'.
Code:
Sheets("Scorecard").Cells(25, 3).Value = "Architecture / Derivative 1"
 
Upvote 0
Big Wade's Suggestion Works. Norie's does not for whatever reason which I do not understand. Thanks for the suggestions.
 
Upvote 0
I didn't make a suggestion, I only indicated which of the lines you posted I was sure would work.:)
 
Upvote 0
I don't see why it doesn't work, Cells(25, 3) and Range("C25"), are the same - just different syntax.:eek:
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,635
Members
449,043
Latest member
farhansadik

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top