Resize issue

christchaaya

Board Regular
Joined
Apr 5, 2013
Messages
86
Hello guys.

I need to resize my activecell to delete some rows. I need to delete below ( 8 rows ) and above my activecell but I have two problems:

- How can i resize above and below my active cell in the same time ?? If it's possible.

- How can i get the first non blank cell above my activecell ?

Thank you in advance everyone ;)
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
This Code Will Assign The Address Of The First Non Blank Cell Above The Activecell To A Variant Address :
Code:
Dim MyRange As Range
Set MyRange = Range(Cells(Activecell.Row + 1, Activecell.column).Address & ":" & Cells(1, ActiveCell.Column).Address)
For Each cell In MyRange
    If cell.Value <> "" Then
       Address = cell.Address(0, 0)
       Exit For
    End If
Next

I need to resize my activecell to delete some rows. I need to delete below ( 8 rows ) and above my activecell
I don't understand what do you mean.Do you mean to delete 8 rows below the Activecell then resize the 9th row?

ZAX
 
Last edited:
Upvote 0
Zax,

I think he wants to xlup from i then go back to i and down a further 8, the bit I am struggling with there is the count to where the xlup stops.
 
Upvote 0
Perhaps:

Code:
If Activecell.Row>1 Then
   If Activecell.Offset(-1).Value<>"" Then
       Activecell.Offset(-1).Resize(10).EntireRow.Delete
   Else
       Range(Activecell.End(xlUp),Activecell.Offset(8)).EntireRow.Delete
  End If
Else
  Activecell.Resize(9).EntireRow.Delete
End If
 
Upvote 0
Range(Activecell.End(xlUp),Activecell.Offset(8)).EntireRow.Delete


Thats that bit answered.
 
Upvote 0
Ops :D Sorry but I'm trying to finish the code so I didn't noticed that , i thought it was a correction of his code :S Anyway thank you both guys :D

Best regards.
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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