Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Inserting a Row with VBA

Excel 2000

This is driving me nuts!

All I want to do is insert a row at the current position, then move down
two rows. I recorded a macro, but the resulting macro contains A1-style
references. The macro needs to be dynamic, so it needs to use R1C1-style
references.

I've done this type of thing before, but can't for the life of me
remember how. I tried the online "Help", which was utterly useless. It
appears the Microsoft has done a fine job in totally burying any
informaiton that would actually be useful in solving this problem.

Does anyone know how to do this?

--Tom
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Inserting a Row with VBA

On Fri, 28 Nov 2003 04:59:30 -0700, Thomas M wrote:

Excel 2000

This is driving me nuts!

All I want to do is insert a row at the current position, then move down
two rows. I recorded a macro, but the resulting macro contains A1-style
references. The macro needs to be dynamic, so it needs to use R1C1-style
references.

I've done this type of thing before, but can't for the life of me
remember how. I tried the online "Help", which was utterly useless. It
appears the Microsoft has done a fine job in totally burying any
informaiton that would actually be useful in solving this problem.

Does anyone know how to do this?

--Tom


ActiveCell.EntireRow.Insert
ActiveCell.Offset(2).Select
--
auric "underscore" "underscore" "at" hotmail "dot" com
*****
Misfortune: The kind of fortune that never misses.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Inserting a Row with VBA

Try this

Selection.EntireRow.Insert
ActiveCell.Offset(2, 0).Select

Lars Kofod

-----Original Message-----
Excel 2000

This is driving me nuts!

All I want to do is insert a row at the current

position, then move down
two rows. I recorded a macro, but the resulting macro

contains A1-style
references. The macro needs to be dynamic, so it needs

to use R1C1-style
references.

I've done this type of thing before, but can't for the

life of me
remember how. I tried the online "Help", which was

utterly useless. It
appears the Microsoft has done a fine job in totally

burying any
informaiton that would actually be useful in solving

this problem.

Does anyone know how to do this?

--Tom
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Inserting a Row with VBA

Tom
How about:

Selection.EntireRow.Insert
ActiveCell.Offset(2, 0).Range("A1").Select

Regards
Philip


"Thomas M" wrote in message
...
Excel 2000

This is driving me nuts!

All I want to do is insert a row at the current position, then move down
two rows. I recorded a macro, but the resulting macro contains A1-style
references. The macro needs to be dynamic, so it needs to use R1C1-style
references.

I've done this type of thing before, but can't for the life of me
remember how. I tried the online "Help", which was utterly useless. It
appears the Microsoft has done a fine job in totally burying any
informaiton that would actually be useful in solving this problem.

Does anyone know how to do this?

--Tom



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Inserting a Row with VBA

Try something like that.
Sub a()
ActiveCell.EntireRow.Select
Selection.Insert Shift:=xlDown
ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select
End Sub
Thomas M wrote in message m...
Excel 2000

This is driving me nuts!

All I want to do is insert a row at the current position, then move down
two rows. I recorded a macro, but the resulting macro contains A1-style
references. The macro needs to be dynamic, so it needs to use R1C1-style
references.

I've done this type of thing before, but can't for the life of me
remember how. I tried the online "Help", which was utterly useless. It
appears the Microsoft has done a fine job in totally burying any
informaiton that would actually be useful in solving this problem.

Does anyone know how to do this?

--Tom



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Inserting a Row with VBA


"Auric__" wrote in message
...
On Fri, 28 Nov 2003 04:59:30 -0700, Thomas M wrote:

Excel 2000

This is driving me nuts!

All I want to do is insert a row at the current position, then move down
two rows. I recorded a macro, but the resulting macro contains A1-style
references. The macro needs to be dynamic, so it needs to use R1C1-style
references.

I've done this type of thing before, but can't for the life of me
remember how. I tried the online "Help", which was utterly useless. It
appears the Microsoft has done a fine job in totally burying any
informaiton that would actually be useful in solving this problem.

Does anyone know how to do this?

--Tom


ActiveCell.EntireRow.Insert
ActiveCell.Offset(2).Select
--
auric "underscore" "underscore" "at" hotmail "dot" com
*****
Misfortune: The kind of fortune that never misses.


Thanks for the help! It works great. Now that I see it, I do remember
coming across Offset before, but that was a long time ago. The last time I
tried to do something like this, I used R1C1 references, and it worked, but
I just couldn't get the syntax right this time, and for some reason I
couldn't find it in Help. This method looks better, though.

--Tom


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Inserting a Row with VBA

Thanks to all who replied. I have it working now.

--Tom

"Thomas M" wrote in message
...
Excel 2000

This is driving me nuts!

All I want to do is insert a row at the current position, then move down
two rows. I recorded a macro, but the resulting macro contains A1-style
references. The macro needs to be dynamic, so it needs to use R1C1-style
references.

I've done this type of thing before, but can't for the life of me
remember how. I tried the online "Help", which was utterly useless. It
appears the Microsoft has done a fine job in totally burying any
informaiton that would actually be useful in solving this problem.

Does anyone know how to do this?

--Tom



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Inserting a Row with VBA

On Fri, 28 Nov 2003 22:14:34 -0700, MT DOJ Help Desk wrote:

"Auric__" wrote in message
.. .

ActiveCell.EntireRow.Insert
ActiveCell.Offset(2).Select
--
auric "underscore" "underscore" "at" hotmail "dot" com
*****
Misfortune: The kind of fortune that never misses.


Thanks for the help! It works great. Now that I see it, I do remember
coming across Offset before, but that was a long time ago. The last time I
tried to do something like this, I used R1C1 references, and it worked, but
I just couldn't get the syntax right this time, and for some reason I
couldn't find it in Help. This method looks better, though.


It *is* R1C1. Offset works like this:
Offset ([Rows], [Columns])
So you can move left and right, also - leaving Rows empty - Offset( , 1)
- changes columns without changing rows.
--
auric "underscore" "underscore" "at" hotmail "dot" com
*****
My Go amn keyboar oesn't have any 's!
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
Inserting new row Sure Excel Worksheet Functions 2 September 20th 08 02:35 AM
inserting row GARY Excel Discussion (Misc queries) 3 April 28th 08 11:26 AM
inserting zero dfg Excel Discussion (Misc queries) 3 May 22nd 06 12:37 PM
inserting zero dfg Excel Worksheet Functions 1 May 22nd 06 12:28 PM
Inserting zero ananga Excel Discussion (Misc queries) 2 July 1st 05 05:41 PM


All times are GMT +1. The time now is 09:13 AM.

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

About Us

"It's about Microsoft Excel"