Setting text in a macro?

liampog

Active Member
Joined
Aug 3, 2010
Messages
308
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi there

Is there a shorter solution to the following code?

Range("F15").Value = ""
Range("F16").Value = ""
Range("F17").Value = ""
Range("F18").Value = ""
Range("F19").Value = ""
Range("F20").Value = ""
Range("F21").Value = ""
Range("F22").Value = ""
Range("F23").Value = ""
Range("F24").Value = ""
Range("F25").Value = ""
Range("F26").Value = ""
Range("F27").Value = ""
Range("F28").Value = ""
Range("F29").Value = ""
Range("F30").Value = ""
Range("F31").Value = ""
Range("F32").Value = ""
Range("F33").Value = ""
Range("F34").Value = ""
Range("F35").Value = ""
Range("F36").Value = ""
Range("F37").Value = ""
Range("F38").Value = ""
Range("F39").Value = ""
Range("F40").Value = ""
Range("F41").Value = ""
Range("F42").Value = ""
Range("F43").Value = ""
Range("F44").Value = ""
Range("F45").Value = ""
Range("F46").Value = ""
Range("F47").Value = ""
Range("F48").Value = ""
Range("F49").Value = ""
Range("F50").Value = ""

I tried Range("F15:F50").Value = "" but this just didn't work at all.

Am I missing something?

Oh, and I can't use .ClearContents as this comes back with a runtime error because of some Worksheet_Change command I have running.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
You can prevent the Worksheet_Change code from running like this

Code:
Application.EnableEvents = False
Range("F15:F50").ClearContents
Application.EnableEvents = True
 
Upvote 0

Forum statistics

Threads
1,215,030
Messages
6,122,762
Members
449,095
Latest member
m_smith_solihull

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