Selecting a block of cells depending on the values of two others
Closed
jwilson28
Posts
3
Registration date
Friday April 21, 2017
Status
Member
Last seen
December 5, 2017
-
Apr 21, 2017 at 06:53 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 25, 2017 at 12:09 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 25, 2017 at 12:09 PM
Related:
- Selecting a block of cells depending on the values of two others
- Block international calls - Guide
- How to block someone on messenger on iphone - Guide
- Will the blocked contacts get notified if i change my number on whatsapp ✓ - WhatsApp Forum
- To create a network bridge you must select at least two lan ✓ - Network Forum
- You've tried to log in too many times. to protect your account, a temporary block has been placed on logging in. please try again later. ✓ - Facebook Forum
3 responses
Try this. Record your Macro, and view it (edit it). Then change the part of the macro you want to have be dynamic. Post back if you have any questions.
OK, that is a start then. Thanks for you posting back!
Initilize a variable, call it a "ARANGE", and set it as a RANGE.
Set ARANGE to "A50:C50"
now, utilize it as RANGE(ARANGE).select
Try that. You can then set ARANGE to what ever variable (range, cell) you wish!
Initilize a variable, call it a "ARANGE", and set it as a RANGE.
Set ARANGE to "A50:C50"
now, utilize it as RANGE(ARANGE).select
Try that. You can then set ARANGE to what ever variable (range, cell) you wish!
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Apr 25, 2017 at 12:09 PM
Apr 25, 2017 at 12:09 PM
Or try this:
When your active cell is C4 and you add 4 rows you get row 8.
When you add 5 to column C (=3) you will get column H (=8).
So when A50=4 and C50=5 and C4 is active cell, then selected range after macro is run, will be C4 to H8.
Best regards,
Trowa
Sub RunMe() ActiveCell.Resize(Range("A50").Value + 1, Range("C50").Value + 1).Select End Sub
When your active cell is C4 and you add 4 rows you get row 8.
When you add 5 to column C (=3) you will get column H (=8).
So when A50=4 and C50=5 and C4 is active cell, then selected range after macro is run, will be C4 to H8.
Best regards,
Trowa
Apr 22, 2017 at 08:10 AM
I have the code
Sub Select6()
Range(ActiveCell(1, 1), ActiveCell(6, 6)).Select
This code highlights a a block of 6 rows and 6 columns to the right of the active cell
I am struggling to replace the numbers so rather than highlighting the number of cells that are in the code it highlights number of cells from the the values in cells A50 and C50
Jon