Condividi:        

copia dal foglio 1, trova il foglio "x" ed incolla

Vuoi potenziare i tuoi documenti Word? Non sai come si fa una macro in Excel? Devi creare una presentazione in PowerPoint?
Oppure sei passato a OpenOffice e non sei sicuro di come lavorare al meglio?

Moderatori: Anthony47, Flash30005

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 15/02/10 18:00

funzinoa alla grande !!!
grazie mille !!!

mi resta solo 2 cose
una macro che mi permatta di cercare tra i " tutti i fogli " un determinato foglio X per consultarlo

ed una macro che dica a tutto il file di stampre solo in formato a4, ovviamente adattando i margini /rimpicciolendo tutto senza dover stampare a mano ogni foglio.

grazie
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Sponsor
 

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi Anthony47 » 16/02/10 22:18

Per la prima, credo che si possa fare; devi pero' dire che cosa... :D

Per la seconda, excel consente di impostare "adatta pagina a foglio": Menu /File /Imposta pagina, tab Pagina, spunta Adatta a; Ok. Da impostare su ogni foglio, poi salvi il file.
Come pure, quando lanci la stampa hai la possibilita' di spuntare la scelta "(Stampa) Tutta la cartella", cioe' tutti i fogli.

Ciao
Avatar utente
Anthony47
Moderatore
 
Post: 19196
Iscritto il: 21/03/06 16:03
Località: Ivrea

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 17/02/10 12:51

ok per la stampa è andata, grazie .

per qunato riguarda la ricerca dovrei fare questo :
foglio anagrafiche fornitori : colonna A:A ho tutti i nomi dei fornitori , ai quali corrisponde un foglio nominato propio col nome del fornitore

mi serve una macro che cliccando sul nome fornitore mi manda alla pagina del fornitore.
grazie ciao
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi Flash30005 » 17/02/10 13:37

Potrebbe andare bene una macro di questo tipo inserita nell'editor Vba del foglio contenente l'elenco
Codice: Seleziona tutto
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
URF = Range("A" & Rows.Count).End(xlUp).Row
CheckArea = "A2:A" & URF
If Not Application.Intersect(ActiveCell, Range(CheckArea)) Is Nothing Then
   Dim FF As String
   FF = Target.Value
   Sheets(FF).Select
End If
End Sub


Se hai molti Fogli (fornitore) sarai costretto a mettere una piccola macro su ogni foglio
Codice: Seleziona tutto
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Application.Intersect(ActiveCell, Range("A1")) Is Nothing Then
    Worksheets("Elenco").Select
End If
End Sub

Per evitare di "spulciare" tra decine o centinaia di fogli per ritrovare il foglio Elenco perché
potrai tornare all'elenco cliccando due volte sulla cella A1 di qualsiasi foglio


Se vuoi fare una cosa più gradevole e leggibile facendo visualizzare solo quel determinato foglio-fornitore nascondendo tutti gli altri
allora chiamerai "Elenco" il foglio elenco fornitori e
sul vba di quel foglio inserirai questa macro
Codice: Seleziona tutto
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
URF = Range("A" & Rows.Count).End(xlUp).Row
CheckArea = "A2:A" & URF
If Not Application.Intersect(ActiveCell, Range(CheckArea)) Is Nothing Then
    Dim FF As String
    FF = Target.Value
     Sheets(FF).Visible = True
    Sheets(FF).Select
    For FN = 1 To Worksheets.Count
    If Sheets(FN).Name = "Elenco" Or Sheets(FN).Name = Sheets(FF).Name Then GoTo salta
    Sheets(FN).Visible = False
salta:
    Next FN
End If
End Sub

Avrai al massimo due fogli visibili: Foglio Elenco e Foglio Fornitore (scelto)
e si renderebbe inutile la macro su ogni foglio per tornare all'indice

In tutti i casi i nomi dei fogli devono corrispondere esattamente a quanto riportato nella colonna "A" dell'elenco

Fai sapere
Ciao
Flash
Win10 + Office 2010 Ita
"Fotografica" al servizio dell'immagine
Avatar utente
Flash30005
Moderatore
 
Post: 8517
Iscritto il: 27/09/07 11:44
Località: Roma +o-

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 17/02/10 16:57

in attesa di mettere a punto questa macro che mi hai dato, vorrei sottoporti questo problema :

con questa macro effettuo un controllo dei materiali in magazzino :

Sub controllo_SCORTA()
' la colonna C è il nome dell'articolo sotto scorta '

Dim CL As Object
Set zona = Sheets("magazzino").Range(Cells(6, 9), Cells(6, 9).End(xlDown))
For Each CL In zona

If CL.Value = 0 Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.:" & CodArt & " DEL FORNITORE: " & NomeForn & " SCORTA FINITA, MAGAZZINO VUOTO"

ElseIf CL.Value = CL.Offset(0, 6).Value Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " E' AL MINIMO di SCORTA"

ElseIf CL.Value < CL.Offset(0, 6).Value Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " E' SOTTO SCORTA"
Dim idomanda As Integer
idomanda = MsgBox("VUOI INSERIRE L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " NEL BUONO ORDINE?", vbYesNo)
If idomanda = vbYes Then
Sheets("magazzino").Range(Cells(6, 9), Cells(6, 9).End(xlDown)).Copy Destination:=Sheets("buono ordine").Range("a" & Rows.Count).End(xlUp).Offset(1, 0)
If idomanda = vbNo Then: Exit Sub

Exit Sub
End If
End If
10:
Next
MsgBox "Articolo Non inserito in buono ordine"
End Sub

la macro mi da un errore che nn riesco a trovare : non mi riporta nella pagina Buono Ordine la riga riferita all'articolo sotto scorta, nel momento in cui clicco yes sul msgbox ( "vuoi inserire l'articolo .... nel buno ordine ?" )
puoi aiutarmi a risolverlo ?
grazie
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 17/02/10 18:14

per quanto riguarda le macro che mi hai scritto , tra le quali ho scelto di usare qeusta:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
URF = Range("A" & Rows.Count).End(xlUp).Row
CheckArea = "A2:A" & URF
If Not Application.Intersect(ActiveCell, Range(CheckArea)) Is Nothing Then
Dim FF As String
FF = Target.Value
Sheets(FF).Visible = True
Sheets(FF).Select
For FN = 1 To Worksheets.Count
If Sheets(FN).Name = "Elenco" Or Sheets(FN).Name = Sheets(FF).Name Then GoTo salta
Sheets(FN).Visible = False
salta:
Next FN
End If
End Sub

mi lancia un debug sempre su questa riga
If Not Application.Intersect(ActiveCell, Range(CheckArea)) Is Nothing Then ....
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi Flash30005 » 17/02/10 21:50

Non dovrebbe dipendere dalla versione di office (quale versione hai?)

Comunque prova questo file

E fai sapere
Ciao
Flash
Win10 + Office 2010 Ita
"Fotografica" al servizio dell'immagine
Avatar utente
Flash30005
Moderatore
 
Post: 8517
Iscritto il: 27/09/07 11:44
Località: Roma +o-

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 18/02/10 13:24

ok funziona.. la pallico a 3 fogli "sempre attivi" in modo da avere i diversi campi "menù"

ora se puoi aiutarmi in questo problema :
con questa macro effettuo un controllo dei materiali in magazzino :

Sub controllo_SCORTA()
' la colonna C è il nome dell'articolo sotto scorta '

Dim CL As Object
Set zona = Sheets("magazzino").Range(Cells(6, 9), Cells(6, 9).End(xlDown))
For Each CL In zona

If CL.Value = 0 Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.:" & CodArt & " DEL FORNITORE: " & NomeForn & " SCORTA FINITA, MAGAZZINO VUOTO"

ElseIf CL.Value = CL.Offset(0, 6).Value Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " E' AL MINIMO di SCORTA"

ElseIf CL.Value < CL.Offset(0, 6).Value Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " E' SOTTO SCORTA"
Dim idomanda As Integer
idomanda = MsgBox("VUOI INSERIRE L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " NEL BUONO ORDINE?", vbYesNo)
If idomanda = vbYes Then
Sheets("magazzino").Range(Cells(6, 9), Cells(6, 9).End(xlDown)).Copy Destination:=Sheets("buono ordine").Range("a" & Rows.Count).End(xlUp).Offset(1, 0)
If idomanda = vbNo Then: Exit Sub

Exit Sub
End If
End If
10:
Next
MsgBox "Articolo Non inserito in buono ordine"
End Sub

la macro mi da un errore che nn riesco a trovare : non mi riporta nella pagina Buono Ordine la riga riferita all'articolo sotto scorta, nel momento in cui clicco yes sul msgbox ( "vuoi inserire l'articolo .... nel buno ordine ?" )
puoi aiutarmi a risolverlo ?
grazie
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi Flash30005 » 18/02/10 14:15

Volentieri,
ma come posso provare la macro?

Ciao
Flash
Win10 + Office 2010 Ita
"Fotografica" al servizio dell'immagine
Avatar utente
Flash30005
Moderatore
 
Post: 8517
Iscritto il: 27/09/07 11:44
Località: Roma +o-

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 18/02/10 14:45

eccolo

http://www.megaupload.com/?d=Q6QWWNE2

quindi sul controllo macro "verifica scorta", premendo Si nel msgbox " vuoi inviare l'articolo nel buono ordine ? , dovrebbe scrivermi la riga dell'articolo nella pagina buono ordine dalla riga 5 in basso.
ciao
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 18/02/10 14:54

http://www.megaupload.com/?d=7DEU6WFU

scusa, prendi in considerazione questo link
ciao
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi Flash30005 » 18/02/10 14:56

controlla se l'indirizzo è valido perché a me dà errore

ciao

p.s. prova a usare rapidshare (a volte i server host hanno questi problemi)
Flash
Win10 + Office 2010 Ita
"Fotografica" al servizio dell'immagine
Avatar utente
Flash30005
Moderatore
 
Post: 8517
Iscritto il: 27/09/07 11:44
Località: Roma +o-

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 18/02/10 15:44

raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 23/02/10 16:47

http://www.megaupload.com/?d=7DEU6WFU

Sub controllo_SCORTA()
' la colonna C è il nome dell'articolo sotto scorta '

Dim CL As Object
Set zona = Sheets("magazzino").Range(Cells(6, 9), Cells(6, 9).End(xlDown))
For Each CL In zona

If CL.Value = 0 Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.:" & CodArt & " DEL FORNITORE: " & NomeForn & " SCORTA FINITA, MAGAZZINO VUOTO"

ElseIf CL.Value = CL.Offset(0, 6).Value Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " E' AL MINIMO di SCORTA"

ElseIf CL.Value < CL.Offset(0, 6).Value Then
DescArt = CL.Offset(0, -6).Value
CodArt = CL.Offset(0, -7).Value
NomeForn = CL.Offset(0, -8).Value
CL.Select
MsgBox "L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " E' SOTTO SCORTA"
Dim idomanda As Integer
idomanda = MsgBox("VUOI INSERIRE L'ARTICOLO:" & DescArt & " COD.: " & CodArt & " DEL FORNITORE: " & NomeForn & " NEL BUONO ORDINE?", vbYesNo)
If idomanda = vbYes Then
Sheets("magazzino").Range(Cells(6, 9), Cells(6, 9).End(xlDown)).Copy Destination:=Sheets("buono ordine").Range("a" & Rows.Count).End(xlUp).Offset(1, 0)
If idomanda = vbNo Then: Exit Sub

Exit Sub
End If
End If
10:
Next
MsgBox "Articolo Non inserito in buono ordine"
End Sub

la macro mi da un errore che nn riesco a trovare : non mi riporta nella pagina Buono Ordine la riga riferita all'articolo sotto scorta, nel momento in cui clicco yes sul msgbox ( "vuoi inserire l'articolo .... nel buno ordine ?" )
puoi aiutarmi a risolverlo ?
grazie
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi Flash30005 » 23/02/10 22:07

Ciao Raffygrp

La macro che avevi non poteva funzionare...
prova questa macro (sostituisci la tua interamente)
Codice: Seleziona tutto
Public Risp, Riga As Integer
Sub controllo_SCORTA()
Dim CL As Object
Set zona = Sheets("magazzino").Range(Cells(6, 9), Cells(6, 9).End(xlDown))
For Each CL In zona
    Risp = 0
If CL.Value = 0 Then
    DescArt = CL.Offset(0, -6).Value
    CodArt = CL.Offset(0, -7).Value
    NomeForn = CL.Offset(0, -8).Value
    CL.Select
    MsgBox "L'ARTICOLO:" & DescArt & "    COD.:" & CodArt & "   DEL FORNITORE: " & NomeForn & "    SCORTA FINITA, MAGAZZINO VUOTO"
    Riga = CL.Row
    Call Creaordine
End If
If CL.Value = CL.Offset(0, 6).Value Then
    DescArt = CL.Offset(0, -6).Value
    CodArt = CL.Offset(0, -7).Value
    NomeForn = CL.Offset(0, -8).Value
    CL.Select
    MsgBox "L'ARTICOLO:" & DescArt & "    COD.: " & CodArt & "    DEL FORNITORE: " & NomeForn & "     E' AL MINIMO di SCORTA"
    Riga = CL.Row
    Call Creaordine
End If
If CL.Value < CL.Offset(0, 6).Value Then
    DescArt = CL.Offset(0, -6).Value
    CodArt = CL.Offset(0, -7).Value
    NomeForn = CL.Offset(0, -8).Value
    CL.Select
    MsgBox "L'ARTICOLO:" & DescArt & "    COD.: " & CodArt & "    DEL FORNITORE: " & NomeForn & "     E' SOTTO SCORTA"
    Riga = CL.Row
    Call Creaordine
End If
If Risp = 0 Then MsgBox "Articolo Non inserito in buono ordine"
Next
End Sub
Sub Creaordine()
idomanda = MsgBox("VUOI INSERIRE L'ARTICOLO:" & DescArt & "    COD.: " & CodArt & "    DEL FORNITORE: " & NomeForn & "  NEL BUONO ORDINE?", vbYesNo)
If idomanda = vbYes Then
URO = Sheets("buono ordine").Range("a" & Rows.Count).End(xlUp).Row + 1
    Sheets("magazzino").Range(Cells(Riga, 1), Cells(Riga, 6)).Copy Destination:=Sheets("buono ordine").Range("A" & URO)
Risp = 1
End If
End Sub


Fai sapere se ok
Ciao
Flash
Win10 + Office 2010 Ita
"Fotografica" al servizio dell'immagine
Avatar utente
Flash30005
Moderatore
 
Post: 8517
Iscritto il: 27/09/07 11:44
Località: Roma +o-

Re: copia dal foglio 1, trova il foglio "x" ed incolla

Postdi raffygrp » 24/02/10 11:10

alla GRANDE !!!
grazie mille!!

un mega saluto !!
raffygrp
Utente Junior
 
Post: 53
Iscritto il: 24/01/10 20:31

Precedente

Torna a Applicazioni Office Windows


Topic correlati a "copia dal foglio 1, trova il foglio "x" ed incolla":


Chi c’è in linea

Visitano il forum: Nessuno e 28 ospiti

cron