Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting an entire column causes sub to stop
I used the
Selection.EntireColumn.Insert command at the point where i wanted the column inserted , it inserted the column and won't process any more steps. Please Help. After inserting the column, the code just stops and won't go any further WITHOUT AN ERROR MESSAGE. Please Help Code follows Sub addcolumn() Dim n As Integer Dim Codecols As Integer Dim Addcol As Boolean Dim Delcol As Boolean Application.Goto Reference:="colOffSet" n = ActiveCell Codecols = n + 5 Application.Goto Reference:="addcol" Addcol = ActiveCell Application.Goto Reference:="delcol" Delcol = ActiveCell Sheets("Ledger").Select ActiveSheet.Unprotect ' If Addcol = True Then Sheets("Ledger").Select Application.Goto Reference:="R1C" & Codecols ActiveCell.Activate Selection.EntireColumn.Insert Range("B52").Select Else If Delcol = True Then Sheets("Ledger").Select Application.Goto Reference:="R1C" & Codecols Selection.EntireColumn.Delete End If End If RefreshRank End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting an entire column causes sub to stop
n2T,
Your codes says after inserting the column to select cell B52 and then run the RefreshRank procedure. Is cell B52 selected? Is the RefreshRank procedure running? -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "new2Texas" wrote in message I used the Selection.EntireColumn.Insert command at the point where i wanted the column inserted , it inserted the column and won't process any more steps. Please Help. After inserting the column, the code just stops and won't go any further WITHOUT AN ERROR MESSAGE. Please Help Code follows Sub addcolumn() Dim n As Integer Dim Codecols As Integer Dim Addcol As Boolean Dim Delcol As Boolean Application.Goto Reference:="colOffSet" n = ActiveCell Codecols = n + 5 Application.Goto Reference:="addcol" Addcol = ActiveCell Application.Goto Reference:="delcol" Delcol = ActiveCell Sheets("Ledger").Select ActiveSheet.Unprotect ' If Addcol = True Then Sheets("Ledger").Select Application.Goto Reference:="R1C" & Codecols ActiveCell.Activate Selection.EntireColumn.Insert Range("B52").Select Else If Delcol = True Then Sheets("Ledger").Select Application.Goto Reference:="R1C" & Codecols Selection.EntireColumn.Delete End If End If RefreshRank End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting an entire column causes sub to stop
Try stepping through the code manually to see if it goes to the RefreshRank
line. Since your references are not available it is difficult for me to see what happens, but it looks like it would step all the way through, if your GoTo references are valid. "new2Texas" wrote: I used the Selection.EntireColumn.Insert command at the point where i wanted the column inserted , it inserted the column and won't process any more steps. Please Help. After inserting the column, the code just stops and won't go any further WITHOUT AN ERROR MESSAGE. Please Help Code follows Sub addcolumn() Dim n As Integer Dim Codecols As Integer Dim Addcol As Boolean Dim Delcol As Boolean Application.Goto Reference:="colOffSet" n = ActiveCell Codecols = n + 5 Application.Goto Reference:="addcol" Addcol = ActiveCell Application.Goto Reference:="delcol" Delcol = ActiveCell Sheets("Ledger").Select ActiveSheet.Unprotect ' If Addcol = True Then Sheets("Ledger").Select Application.Goto Reference:="R1C" & Codecols ActiveCell.Activate Selection.EntireColumn.Insert Range("B52").Select Else If Delcol = True Then Sheets("Ledger").Select Application.Goto Reference:="R1C" & Codecols Selection.EntireColumn.Delete End If End If RefreshRank End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to stop toolbar drop box of entire cell contents | Excel Discussion (Misc queries) | |||
How do I stop Excel from auto-inserting a date? | Excel Discussion (Misc queries) | |||
Inserting worksheet makes formulae stop working | Excel Discussion (Misc queries) | |||
inserting rows in entire sheet | Excel Discussion (Misc queries) | |||
Inserting Entire Rows | Excel Programming |