View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
argv argv is offline
external usenet poster
 
Posts: 1
Default [VBA] pb with "group" method


Hi everyone,

I'm trying to developp a VBA code which will group a range of columns
together "dynamically", but I have a pb ! Here the code :

Code:
--------------------
Sub Group(iNumSheet, iColumnsDeb)
For IColumns = iColumnsDeb To iColumnsDeb + 200
If xlapp.ActiveWorkbook.Sheets(iNumSheet).Cells(7, IColumns).Font.Bold = True And xlapp.ActiveWorkbook.Sheets(iNumSheet).Cells(7, IColumns).Font.Italic = True Then
xlapp.ActiveWorkbook.Sheets(iNumSheet).Range(Cells (7, iColumnsDeb), Cells(7, IColumns - 1)).Columns.Group
End If
Next
End Sub
--------------------


I try to execute once, it's working, yeah !
But a seconde time does not work : I have this pb :
"The cells method of the object '_globals' failed".
Do you have any idea of what's goin' on ?
Thank you

PS : sorry for my english (I'm French !)


--
argv
------------------------------------------------------------------------
argv's Profile: http://www.excelforum.com/member.php...o&userid=37099
View this thread: http://www.excelforum.com/showthread...hreadid=568269