Problems with setting cell value using VBA

LSM1604

New Member
Joined
Jan 8, 2010
Messages
49
Hey everyone,

I was wondering if someone could help me with something please?

I am writing some code to change mass numbers of cell values but it will not work. This issue is the use of "" (quotation marks)

Here is an example of what I would like:

Code:
Range("C68").Value = "=COUNTIF(C9:C44,"")"

I get an error each time I try to get the code to run because of the "" after C9:C44,

I require the "" in the cell values because it the workbook is looking for empty cells within that range.


Many thanks,
LSM1604
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You have to add extra quation marks in the VBA code for forumlas.
Try this:
Code:
Range("C68").Value = "=COUNTIF(C9:C44,"""")"
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,726
Members
452,939
Latest member
WCrawford

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