Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 02-06-2024, 12:08 AM
ArviLaanemets ArviLaanemets is offline Select cells in an array Windows 8 Select cells in an array Office 2016
Expert
 
Join Date: May 2017
Posts: 875
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

At start you declared you need to select 30 cells, now it is 140 cells!?

OK! Let's it be 140 (or less, as you can't select 140 cells with your conditions, when you are e.g. on row 10).

Define a dynamic range (Main Menu>Formulas>Name Manager) e.g. dnRange140 as
Code:
=OFFSET(YourSheetName!$A$1,MAX((ROW()-140)-1,0),,MAX(MIN((ROW()),140),1),1)
Now you can use this dynamic name a reference, which returns a range of cells depending on your active row number, and ending at your active row. P.e. when you enter into D1 the formula =COUNT(dnRange140), and copy it down to D173, the returned values start from 1 in first row to 140 in 140 row, and remains 140 after that. In case you activate a cell in row 169, the number of cells in dnRange140 is 140, and the returned range is A29:A169.

Edit. When you activate any cell on this sheet, then open Name Manager from menu, activate this Named Range, and then click on Refers To field, the current range of it will be marked as active on your sheet - so you can see which cells are included at this moment.
Reply With Quote
 

Tags
select cells



Similar Threads
Thread Thread Starter Forum Replies Last Post
Select a range of cells to cpy based on a text searh oscarlimerick Excel 2 07-18-2023 01:27 PM
Select cells in an array Select all cells in a column , even when blank... Chayes Excel Programming 4 05-30-2018 10:35 AM
Conditional formating all cells in an array based on adjacent cells deejay Excel 6 12-20-2016 12:00 PM
Select cells in an array Help with Index Function to Select Range of Cells bretyuin Excel 1 02-24-2016 05:11 AM
Select cells in an array Convert String Array to Integer Array from a User Input? tinfanide Excel Programming 4 12-26-2012 08:56 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:55 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft