![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
How do I write a macro to do the following: Suppose the active cell is A1. I need to delete rows - 1,2,3,6,10,12,13 and 14. But I need to it be relative to where the active cell is. I've tried recording it but it keeps going back to A1 and doing the macro again. I need it to perform the task starting wherever the active cell is Any ideas? |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi
Try: ActiveCell.Range("A1,A2,A3,A6,A10,A12,A13,A14").EntireRow.Delete It's relative to the activecell |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
Dave you are an angel!
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Something like this should work, the row is offset based upon the activecell. I'm not sure if I recommend doing this since you can irreversibly delete data by mistake using "Activecell". Anyway, here's what you asked for:
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|