#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Autofill

Hi,

I`m trying to create a macro that ranges the above 5 rows and columns
(A to D) no matter where I am on the worksheet and then autofill down
to 1 row down.
Then I want it to insert a row down and do 10 above rows and columns
(a to d).

Can anyone please help me with this.

I hope I have explained my self clearly - I just don`t know how to
explain it.

-got to know where I am in the worksheet
-range the above 5 rows colums a to d
-then fill 1 row down
-insert a row (down)
- then do the same procedure but 10 rows up and then all over again.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Autofill

Hi Carmela

You can know where you are in the worksheet with Activecell property.

Dim lngR As Long
lngR = ActiveCell.Row
Range(Cells(lngR - 5, "A"), Cells(lngR - 1, "E")).Select

Regarding to other things, I think Recording macro shows you the code.

HTH

--
Kind Regards
Colo ------------------------------------------------------------------
Masaru Kaji (aka Colo) Office Systems - Excel MSMVP(2004-2005)

Web site: Colo's Excel Junk Room
http://www.interq.or.jp/sun/puremis/colo/

Email:

------------------------------------------------------------------


"Carmela" wrote in message
om...
Hi,

I`m trying to create a macro that ranges the above 5 rows and columns
(A to D) no matter where I am on the worksheet and then autofill down
to 1 row down.
Then I want it to insert a row down and do 10 above rows and columns
(a to d).

Can anyone please help me with this.

I hope I have explained my self clearly - I just don`t know how to
explain it.

-got to know where I am in the worksheet
-range the above 5 rows colums a to d
-then fill 1 row down
-insert a row (down)
- then do the same procedure but 10 rows up and then all over again.

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoFill Gmata Excel Discussion (Misc queries) 1 June 20th 09 06:59 AM
AutoFill A to Z Hardeep kanwar New Users to Excel 4 March 29th 09 07:59 AM
AutoFill carl Excel Worksheet Functions 3 May 22nd 07 07:06 PM
AutoFill autofill Excel Discussion (Misc queries) 1 February 20th 06 08:29 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM


All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"