Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "range("F:F")" mean in an Excel macro?

Tags:

excel

vba

I'm debugging a macro and have very little experience with them, what does the f:f mean? I understand the first range and I'm guessing the f:f means the currently selected range but that's just a guess.

       ws.Range("A1:M65536").ClearContents
       ws.Range("F:F").FormatConditions.Delete

Could someone clarify for me please?

like image 850
Jacxel Avatar asked May 15 '12 14:05

Jacxel


People also ask

What is range in Excel macro?

Range is a property in VBA that helps specify a particular cell, a range of cells, a row, a column, or a three-dimensional range. In the context of the Excel worksheet, the VBA range object includes a single cell or multiple cells spread across various rows and columns.

How do I set a range for a macro in Excel?

Click on Insert tab > select Module. Step 2: Write the subprocedure for VBA Set Range as shown below. Step 3: Declare the variable using DIM as Range object as shown below. Step 4: Further setting up the range object with declared variable MyRange, we will then choose the cell which wants to include.

What is range data type in VBA?

In VBA we have a data type as a range that is used to define variables as a range that can hold a value of the range. These variables are very useful in complex programming and automation. Often variable range is used with the set statements and range method.

What is the difference between cells and range in VBA?

The Cells and Range functions let you tell your VBA script exactly where on your worksheet you want to obtain, or place data. The main difference between the two cells is what they reference. The VBA cells function usually references a single cell at a time, while Range references a group of cells at once.


2 Answers

It means the range that is the entire F column. F:H is columns F, G and H etc.

like image 153
Martin Liversage Avatar answered Oct 03 '22 06:10

Martin Liversage


F:F means the entire F column.

like image 23
SLaks Avatar answered Oct 03 '22 08:10

SLaks