2009-01-08 11 views

Répondre

1

Malheureusement, il n'existe pas de méthode simple pour cela. Vous devrez parcourir toutes les lignes de la feuille source et créer les mêmes lignes dans la feuille de destination. .: par exemple

Dim oPageSheet1 As Visio.Shape 
Dim oPageSheet2 As Visio.Shape 
Dim rowName  As String 
Dim i As Integer 

Set oPageSheet1 = Visio.ActiveDocument.Pages.Item(1).PageSheet 
Set oPageSheet2 = Visio.ActiveDocument.Pages.Item(2).PageSheet 

i = visRowUser 

While oPageSheet1.CellsSRCExists(visSectionUser, i, visUserValue, False) 
    oPageSheet2.AddNamedRow visSectionUser, oPageSheet1.Section(visSectionUser).Row(i).NameU, 0 
    oPageSheet2.Section(visSectionUser).Row(i).Name = oPageSheet1.Section(visSectionUser).Row(i).Name 
    oPageSheet2.CellsSRC(visSectionUser, i, visUserValue).FormulaU = oPageSheet1.CellsSRC(visSectionUser, i, visUserValue).FormulaU 
    oPageSheet2.CellsSRC(visSectionUser, i, visUserPrompt).FormulaU = oPageSheet1.CellsSRC(visSectionUser, i, visUserPrompt).FormulaU 
    i = i + 1 
Wend 

Si vous devez copier un grand nombre de lignes et de la performance est une considération que vous devez enquêter sur l'utilisation AddRows et SetFormulas.

Questions connexes