Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi guys and girls, Could anyone help me please. I am trying to insert a new row using a variable called "countrytotal". The idea is to add all the rows where there is data (which I have done and is stored in "countrytotal") and then use the value of "countrytotal" + 1 to insert the next row for new data to be added. To do it using numbers it's: Rows("6:6").Select Selection.Insert Shift:=xlDown but I want to replace the "6:6" with the variable "countrytotal" if it is possible. Any help will be very much appreciated. Thanks, T8RSP -- T8RSP ------------------------------------------------------------------------ T8RSP's Profile: http://www.excelforum.com/member.php...o&userid=28452 View this thread: http://www.excelforum.com/showthread...hreadid=482215 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I understand correctly, I think the syntax you are looking for is
something like: Rows(CountryTotal & ":" & CountryTotal).Insert Shift:=xlDown HTH/ "T8RSP" wrote: Hi guys and girls, Could anyone help me please. I am trying to insert a new row using a variable called "countrytotal". The idea is to add all the rows where there is data (which I have done and is stored in "countrytotal") and then use the value of "countrytotal" + 1 to insert the next row for new data to be added. To do it using numbers it's: Rows("6:6").Select Selection.Insert Shift:=xlDown but I want to replace the "6:6" with the variable "countrytotal" if it is possible. Any help will be very much appreciated. Thanks, T8RSP -- T8RSP ------------------------------------------------------------------------ T8RSP's Profile: http://www.excelforum.com/member.php...o&userid=28452 View this thread: http://www.excelforum.com/showthread...hreadid=482215 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another possible method:
Rows(CountryTotal).EntireRow.Insert Shift:=xlDown HTH/ "T8RSP" wrote: Hi guys and girls, Could anyone help me please. I am trying to insert a new row using a variable called "countrytotal". The idea is to add all the rows where there is data (which I have done and is stored in "countrytotal") and then use the value of "countrytotal" + 1 to insert the next row for new data to be added. To do it using numbers it's: Rows("6:6").Select Selection.Insert Shift:=xlDown but I want to replace the "6:6" with the variable "countrytotal" if it is possible. Any help will be very much appreciated. Thanks, T8RSP -- T8RSP ------------------------------------------------------------------------ T8RSP's Profile: http://www.excelforum.com/member.php...o&userid=28452 View this thread: http://www.excelforum.com/showthread...hreadid=482215 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks for that Quartz - it did the trick -- T8RS ----------------------------------------------------------------------- T8RSP's Profile: http://www.excelforum.com/member.php...fo&userid=2845 View this thread: http://www.excelforum.com/showthread.php?threadid=48221 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Inserting and retaining an input variable | Excel Discussion (Misc queries) | |||
Inserting rows at variable points | Excel Programming | |||
Inserting Variable Number of Rows | Excel Programming | |||
Inserting a variable number of rows in a worksheet | Excel Programming | |||
inserting a variable into VB | Excel Programming |