ruismb Posted November 16, 2009 at 03:07 PM Report Share #296483 Posted November 16, 2009 at 03:07 PM Boa tarde, tenho um problema em excel que gostaria de saber se é possível resolver. Será possivel criar um ciclo que me seleccione um conjunto de folhas como o exemplo que se segue. Range("B3").Select ActiveCell.FormulaR1C1 = "='Documento1'!R7C15" Range("B4").Select ActiveCell.FormulaR1C1 = "='Documento2'!R7C15" Range("B5").Select ActiveCell.FormulaR1C1 = "='Documento3'!R7C15" Range("B6").Select ActiveCell.FormulaR1C1 = "='Documento4'!R7C15" Range("B7").Select ActiveCell.FormulaR1C1 = "='Documento5'!R7C15" Range("B8").Select ActiveCell.FormulaR1C1 = "='Documento7'!R7C15" Range("B9").Select ActiveCell.FormulaR1C1 = "='Documento8'!R7C15" Range("B10").Select ActiveCell.FormulaR1C1 = "='Documento9'!R7C15" Range("B11").Select Em que Documento1, Documento2 .... são as folhas. Antecipadamente grato, Rui Barbosa Link to comment Share on other sites More sharing options...
jpaulino Posted November 16, 2009 at 05:17 PM Report Share #296504 Posted November 16, 2009 at 05:17 PM Olá, Algo do género deve dar (exemplo): Dim x As Integer For x = 1 To 10 Range("b" & (x + 3)).FormulaR1C1 = "='Documento" & x & "'!R7C15" Next Link to comment Share on other sites More sharing options...
ruismb Posted November 17, 2009 at 10:01 AM Author Report Share #296617 Posted November 17, 2009 at 10:01 AM Bom dia ... agradeço a atenção e funciona mais ou menos como queria, contudo não funciona muito bem se a folha que está a percorrer no ciclo não existir, como conseguiria ultrapassar isso? Cumps, Rui Barbosa Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now