Display highlighted cells dimensions

anas_hilow

New Member
Joined
Sep 26, 2013
Messages
2
Hello,

We are working on a warehouse layout, which has huge floorspace, using excel spreadsheet. the layout scale is good enough to represent each square cell as One Square foot. We're trying to measure certain areas by highlighting group of cells, no matter if they contain values or blank ones, so the x and y axis are displayed at on of the bottom corners of the cells selection and constantly changes the more highlighted cells are selected. For example if you highlight B17 through L23, it is actually "11" cells in the x direction and "7" cells in the y direction which makes it easy to calculate the highlighted area (11' * 7' = 77 ft^2) and promptly changes these values the more highlighted cells would change. I hope there's simple easy method to do it without using VBA or macros or certain codes, otherwise I'm good with them.

Thank you and have a nice weekend ahead!

Anas
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,782
Office Version
  1. 2010
Platform
  1. Windows
Right-click the tab of interest, select View Code, and paste this in the window that opens:

Code:
Private Sub Worksheet_Activate()
  If TypeOf Selection Is Range Then
    Application.StatusBar = Selection.Columns.Count & " x " & _
                            Selection.Rows.Count
  Else
    Application.StatusBar = False
  End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  If TypeOf Selection Is Range Then
    Application.StatusBar = Selection.Columns.Count & " x " & _
                            Selection.Rows.Count
  Else
    Application.StatusBar = False
  End If
End Sub

Private Sub Worksheet_Deactivate()
  Application.StatusBar = False
End Sub
Do Alt+Q to return to Excel. Look at the status bar as you change the selection.
 

anas_hilow

New Member
Joined
Sep 26, 2013
Messages
2
Thanks!! it worked ... Actually I am using Microsoft Office 2013, view code icon is displayed at the "Controls" menue under the "Developer" tab. Also I had to change the file format into Macro-Enabled excel (xlsm) instead of the regular (xlsx) file format.

Thanks again!

Right-click the tab of interest, select View Code, and paste this in the window that opens:

Code:
Private Sub Worksheet_Activate()
  If TypeOf Selection Is Range Then
    Application.StatusBar = Selection.Columns.Count & " x " & _
                            Selection.Rows.Count
  Else
    Application.StatusBar = False
  End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  If TypeOf Selection Is Range Then
    Application.StatusBar = Selection.Columns.Count & " x " & _
                            Selection.Rows.Count
  Else
    Application.StatusBar = False
  End If
End Sub

Private Sub Worksheet_Deactivate()
  Application.StatusBar = False
End Sub
Do Alt+Q to return to Excel. Look at the status bar as you change the selection.
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,782
Office Version
  1. 2010
Platform
  1. Windows
You're welcome.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,311
Messages
5,600,886
Members
414,414
Latest member
neil_c

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