Range name

DaveUK

Board Regular
Joined
Jan 24, 2005
Messages
245
I have this code:

Sub FindNextEmptyCell()
' Finds next emptycell to the right of Row 4
Range("A4").End(xlToRight).Offset(0, 1).Select
End Sub

What i want to do is set this activecell to a name i can refer back to later, using the name "MIDS" and a cell 8 rows down named "NORTH".

Another piece of code i need is also to add the values of the 4 rows before the "MIDS" and store it in a variable called "iReports".

Any help appreciated.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Where do you want to use this name? In the code or as a named range on the worksheet?

How about this?
Code:
Sub FindNextEmptyCell() 
Dim MIDS As Range
Dim NORTH As Range

       Set MIDS=Range("A4").End(xlToRight).Offset(0, 1)
       Set NORTH=MIDS.Offset(8,0)
     
       ' rest of code to work with MIDS/NORTH
End Sub

For your other question can you give more information?

What do you mean by 'rows before'?
 
Upvote 0
Sorry again, never noticed the other bit of the message.

Well say the "MIDS" cell is at "F8" then i want to add the values of "F4 - F7" and put the total in "F8".

Hope that makes sense.
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,109
Members
448,548
Latest member
harryls

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
Back
Top