Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-03-2024, 06:56 AM
xexeu xexeu is offline Select cells in an array Windows 10 Select cells in an array Office 2016
Novice
Select cells in an array
 
Join Date: Oct 2018
Posts: 6
xexeu is on a distinguished road
Unhappy Select cells in an array

In column A I have numbers that are arranged in ascending order, in a range that goes from A! up to A174. If I have to select a certain number of cells, for example, 30 cells, and my initial cell is in line A169, I have to do it manually, starting with cell A169 and continuing the selection from cell A1 until completing the 30 cells.


Is there a way to do this operation using formulas?

Thanks in advance
Reply With Quote
  #2  
Old 02-04-2024, 05:28 PM
Alansidman's Avatar
Alansidman Alansidman is offline Select cells in an array Windows 11 Select cells in an array Office 2021
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 79
Alansidman will become famous soon enoughAlansidman will become famous soon enough
Default

Are the numbers random or sequential? What is the criteria for selection? Once selected, how should they be identified? Moved? Help us to help you with specific information. Crystal balls are not available any longer to help us.
Reply With Quote
  #3  
Old 02-05-2024, 12:25 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: 873
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

Quote:
Originally Posted by xexeu View Post
If I have to select a certain number of cells, for example, 30 cells, and my initial cell is in line A169, I have to do it manually, starting with cell A169 and continuing the selection from cell A1 until completing the 30 cells.
I'm really confused here! Do you want to select cell A169 and cells A1:A29, or what?
Reply With Quote
  #4  
Old 02-05-2024, 10:25 AM
xexeu xexeu is offline Select cells in an array Windows 10 Select cells in an array Office 2016
Novice
Select cells in an array
 
Join Date: Oct 2018
Posts: 6
xexeu is on a distinguished road
Default

I need to make a selection that starts in cell A169 and ends in cell A29. The matrix has 173 rows - it starts at A1 and ends at A173.
I tried =INDEX($A$1:$A$173, ROW(INDEX($A$1:$A$173, 169)):ROW(INDEX($A$1:$A$173, 29))) but it gave an error.

Last edited by xexeu; 02-05-2024 at 12:54 PM.
Reply With Quote
  #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: 873
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
Reply

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 11:56 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