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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

ZAX

Well-known Member
Joined
Jul 5, 2012
Messages
715
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

Dryver14

Well-known Member
Joined
Mar 22, 2010
Messages
2,396
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

Firefly2012

Well-known Member
Joined
Dec 28, 2011
Messages
3,638
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

Dryver14

Well-known Member
Joined
Mar 22, 2010
Messages
2,396
ADVERTISEMENT
Range(Activecell.End(xlUp),Activecell.Offset(8)).EntireRow.Delete


Thats that bit answered.
 
Upvote 0

Dryver14

Well-known Member
Joined
Mar 22, 2010
Messages
2,396
ADVERTISEMENT
I think thats meant for Firefly,

I only asked a question.
 
Upvote 0

christchaaya

Board Regular
Joined
Apr 5, 2013
Messages
86
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,195,640
Messages
6,010,868
Members
441,571
Latest member
stolenweasel

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
Top