Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting new row | Excel Worksheet Functions | |||
inserting row | Excel Discussion (Misc queries) | |||
inserting zero | Excel Discussion (Misc queries) | |||
inserting zero | Excel Worksheet Functions | |||
Inserting zero | Excel Discussion (Misc queries) |