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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
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

Bill Bisco

Active Member
Joined
Aug 8, 2007
Messages
446
Big Wade's Suggestion Works. Norie's does not for whatever reason which I do not understand. Thanks for the suggestions.
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
I didn't make a suggestion, I only indicated which of the lines you posted I was sure would work.:)
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
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,190,558
Messages
5,981,686
Members
439,729
Latest member
purna

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
Top