-
Finding Print Area in a excel worksheet
Hi,
This may seem a bit peculiar but it is interesting indeed.
I am having a cells info like the comment on the cell, its text (cell) value..
I need to know about that in case of a worksheet consists of multiple print areas then that cell will fall under which print area ??
I can post the code also if needed..
Please respond asap...
Thanks,
Jade
-
I'm not quite sure if this is what you're after
[VBA]
Option Explicit
Sub PrintArea()
Dim PA, i%, Check As Boolean
' For info
MsgBox Range("Print_Area").Address
PA = Split(Range("Print_Area").Address, ",")
For i = 0 To UBound(PA)
If Not Intersect(Selection, Range(PA(i))) Is Nothing Then
Check = True
Exit For
End If
Next
If Check Then
MsgBox PA(i)
Else
MsgBox "Cell not in print area"
End If
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
thanks mdmackillop..
I will definitely give it a shot and come back at you...!
Thanks,
Jade
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules