I figli d'arte sono all'altezza dei genitori? Vieni a parlarne su Award & Oscar.
 
Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

stampa con excel2003 / excel2007

Ultimo Aggiornamento: 11/12/2016 11:31
Post: 692
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
25/11/2016 20:44

Ciao a tutti.
Ho creato un foglio excel 2007 per poi stampare i vari dati su un cartoncino precompilato in formato A4 con già stampate le colonne e diciturie varie.
Il problema è che se poi il file lo uso con excel 2000/2003 il tutto, non si incolonna come ho impostato le varie misure delle righe e colonne su excel2007.
C'è qualche opzione per adattare i fogli creatti con le varie versioni di excel?
Un grazie in anticipo.
max
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 420
Registrato il: 16/08/2015
Città: CORDENONS
Età: 67
Utente Senior
Excel 2016-32bit Win11
OFFLINE
26/11/2016 11:39

Se in Excel 2K7 utilizzi un font comune con Excel 2K3 (es. Arial) ed imposti manualmente la larghezza delle colonne e l'altezza delle riga (evitando le impostazioni default) non dovresti avere problemi di stampa a parte quelli dovuti ai parametri della stampante utilizzata (spesso hanno valori di margini minimi diversi).

______________________________________________________________
C'è chi fa le COSE a CASO e chi fa CASO alle COSE (Ignoto)
Post: 696
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
08/12/2016 19:52

Salve,
ma le misure di excel si possono trasformare in mm?
Il cartocino su cui devo stampare è come misure esterne 282x197 mm.
Non riesco ad adattare il foglio excel cambinado versione di excel.
max
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 697
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
08/12/2016 20:56

Ciao.
In rete ho trovato queste 2 macro per regolare righe e colonne in mm:


Sub ColumnWidthInCentimeters()
Dim cm As Single, points As Integer, savewidth As Integer
Dim lowerwidth As Integer, upwidth As Integer, curwidth As Integer
Dim Count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("Enter Column Width in Centimeters", _
"Column Width (cm)", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "Width of " & cm & " is too large." & Chr(10) & _
"The maximum value is " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "Width Error"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
Count = 0
While (ActiveCell.Width <> points) And (Count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
Count = Count + 1
Wend
End Sub


Sub RowHeightInCentimeters()
Dim cm As Single
cm = Application.InputBox("Enter Row Height in Centimeters", _
"Row Height (cm)", Type:=1)
If cm Then
Selection.RowHeight = Application.CentimetersToPoints(cm)
End If
End Sub


ho provato a regolare delle righe in 0,8 cm ma all fine non rusulta esatto.
Ho impostato al 100% le dimensioni ma non rusulta esatto.
max
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 698
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
08/12/2016 21:52

Ma in excel non si possono mettere le misure tipo 23,61?
Scrivo 23,61 ed esce sempre 23,75 [SM=g27826]
max
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 1.023
Registrato il: 06/04/2013
Utente Veteran
2010
OFFLINE
09/12/2016 09:09

Ciao
la vedo dura....excel si comporta in modo diverso tra le sue versioni ed i fattori sono molti. Uno per tutti, excel usa pixel che non hanno frazioni (ecco il motivo dell'arrotondamente al valore più vicino) e la larghezza delle colonne (vale anche per le righe) dipende dal tipo di carattere ecc.

Leggi il seguente articolo:

https://support.microsoft.com/it-it/kb/214123

saluti
[Modificato da dodo47 09/12/2016 09:11]
Domenico
Win 10 - Excel 2016
Post: 699
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
09/12/2016 10:52

Grazie dell'info domenico.
Un saluto.
max
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 700
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
09/12/2016 19:45

Dopo varie prove il calcolo e varie prove di stampa più esatto è questo:

RowHeight = (295.2 / 100) * 10 'per riga H 10 mm
ColumnWidth = (45.9 / 100) * 10 'per colonna L 10 mm

è possibile a queste duee macro trovate in rete modificare il calcolo e portarlo a quello postate sopra?:

Sub SetColumnWidthMM(ColNo As Long, mmWidth As Integer)
' changes the column width to mmWidth
Dim w As Single

    If ColNo < 1 Or ColNo > 255 Then Exit Sub
    Application.ScreenUpdating = False
    
    w = Application.CentimetersToPoints(mmWidth / 10)
    While Columns(ColNo + 1).Left - Columns(ColNo).Left - 0.1 > w
        Columns(ColNo).ColumnWidth = Columns(ColNo).ColumnWidth - 0.1
    Wend
    While Columns(ColNo + 1).Left - Columns(ColNo).Left + 0.1 < w
        Columns(ColNo).ColumnWidth = Columns(ColNo).ColumnWidth + 0.1
    Wend
End Sub

Sub SetRowHeightMM(RowNo As Long, mmHeight As Integer)
' changes the row height to mmHeight
    If RowNo < 1 Or RowNo > 65536 Then Exit Sub
    Rows(RowNo).RowHeight = Application.CentimetersToPoints(mmHeight / 10)
End Sub

'This example macro shows how you can set the row height for row 3 and the column width for column C to 3.5 cm:

Sub ChangeWidthAndHeight()

    SetColumnWidthMM 1, 8 '<<< colonna 1,8 = A L=8mm
    SetRowHeightMM 3, 8 '<<< riga 3,8 = riga 3 L=8mm
    
    SetColumnWidthMM 5, 8
    SetRowHeightMM 6, 8
    
    'Sub rigacolonna()
    'Selection.RowHeight = (295.2 / 100) * 10 'riga
    'Selection.ColumnWidth = (45.9 / 100) * 10 'colonna
    'End Sub
    
    
End Sub





max
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 701
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
10/12/2016 20:18

[SM=g27811]
max
[Modificato da maxma62 10/12/2016 20:19]
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 702
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
11/12/2016 08:22

Salve,
ho provato io ma non gira nulla:
Option Explicit

Sub SetColumnWidthMM(ColNo As Long, mmWidth As Integer)
' changes the column width to mmWidth
Dim w As Single

    If ColNo < 1 Or ColNo > 255 Then Exit Sub
    Application.ScreenUpdating = False
    
    w = Application.CentimetersToPoints(295.2 / 100)
   ' While Columns(ColNo + 1).Left - Columns(ColNo).Left - 0.1 > w
      '  Columns(ColNo).ColumnWidth = Columns(ColNo).ColumnWidth - 0.1
   ' Wend
   ' While Columns(ColNo + 1).Left - Columns(ColNo).Left + 0.1 < w
       ' Columns(ColNo).ColumnWidth = Columns(ColNo).ColumnWidth + 0.1
    'Wend
    
End Sub

Sub SetRowHeightMM(RowNo As Long, mmHeight As Integer)
' changes the row height to mmHeight
    If RowNo < 1 Or RowNo > 65536 Then Exit Sub
    Rows(RowNo).RowHeight = Application.CentimetersToPoints(45.9 / 100)
End Sub

'This example macro shows how you can set the row height for row 3 and the column width for column C to 3.5 cm:

Sub ChangeWidthAndHeight()

    SetColumnWidthMM 1, 8 '<<< colonna 1,8 = A L=8mm
    SetRowHeightMM 3, 8 '<<< riga 3,8 = riga 3 L=8mm
    
    SetColumnWidthMM 5, 8
    SetRowHeightMM 6, 8
    
                        'Sub rigacolonna()
                        'Selection.RowHeight = (295.2 / 100) * 10 'riga
                        'Selection.ColumnWidth = (45.9 / 100) * 10 'colonna
                        'End Sub
    
    
End Sub




un aiuto?
max
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 1.025
Registrato il: 06/04/2013
Utente Veteran
2010
OFFLINE
11/12/2016 09:24

Ciao
premesso quanto ti ho già detto, quel codice "non gira" perché hai commentato i while - wend.

Ciò detto, personalmente, non ho capito che devi fare. Perché non sottoponi un esempio con quello che hai e quello che vuoi ottenere, con scritte le dimensioni di righe/colonne e relativo output?

saluti
Domenico
Win 10 - Excel 2016
Post: 703
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
11/12/2016 10:08

Spero ora di spiegarami:
queste 2 macro:

Option Explicit

Sub SetColumnWidthMM(ColNo As Long, mmWidth As Integer)
' changes the column width to mmWidth
Dim w As Single

    If ColNo < 1 Or ColNo > 255 Then Exit Sub
    Application.ScreenUpdating = False
    
    w = Application.CentimetersToPoints(mmWidth / 10)
    While Columns(ColNo + 1).Left - Columns(ColNo).Left - 0.1 > w
        Columns(ColNo).ColumnWidth = Columns(ColNo).ColumnWidth - 0.1
    Wend
    While Columns(ColNo + 1).Left - Columns(ColNo).Left + 0.1 < w
        Columns(ColNo).ColumnWidth = Columns(ColNo).ColumnWidth + 0.1
    Wend
End Sub

Sub SetRowHeightMM(RowNo As Long, mmHeight As Integer)
' changes the row height to mmHeight
    If RowNo < 1 Or RowNo > 65536 Then Exit Sub
    Rows(RowNo).RowHeight = Application.CentimetersToPoints(mmHeight / 10)
End Sub

'This example macro shows how you can set the row height for row 3 and the column width for column C to 3.5 cm:

Sub ChangeWidthAndHeight()

    SetColumnWidthMM 1, 8 '<<< colonna 1,8 = A L=8mm
    SetColumnWidthMM 2, 18
    SetColumnWidthMM 3, 8
    SetColumnWidthMM 4, 18
    SetColumnWidthMM 5, 8
    SetColumnWidthMM 6, 18
    SetColumnWidthMM 7, 8
    SetColumnWidthMM 8, 28
    SetColumnWidthMM 9, 8
    SetColumnWidthMM 10, 28
    SetColumnWidthMM 11, 8
    SetColumnWidthMM 12, 18
    SetColumnWidthMM 13, 8
    SetColumnWidthMM 14, 18
    SetColumnWidthMM 15, 8
    
    
    SetRowHeightMM 1, 8
    SetRowHeightMM 2, 18
    SetRowHeightMM 3, 8
    SetRowHeightMM 4, 18
    SetRowHeightMM 5, 28
    SetRowHeightMM 6, 8
    SetRowHeightMM 7, 28
    SetRowHeightMM 8, 8
    SetRowHeightMM 9, 28
    SetRowHeightMM 10, 8
    SetRowHeightMM 11, 28
    SetRowHeightMM 12, 8
    SetRowHeightMM 13, 18
    SetRowHeightMM 14, 8
    SetRowHeightMM 15, 18
      
    'Sub rigacolonna()
    'Selection.RowHeight = (295.2 / 100) * 10 'riga
    'Selection.ColumnWidth = (45.9 / 100) * 10 'colonna
    'End Sub
    
    
End Sub




non funzionano bene come risultato, le misure non sono esatte.
La modifica che chiedo è che il calcolo venga fatto con l'altra macro:

Sub rigacolonna()
    'Selection.RowHeight = (295.2 / 100) * 10 'riga
    'Selection.ColumnWidth = (45.9 / 100) * 10 'colonna
    'End Sub


spero ora di essermi spiegato.
max
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Post: 1.026
Registrato il: 06/04/2013
Utente Veteran
2010
OFFLINE
11/12/2016 10:52

si
ma le tue misure 8 - 18 - 28 a quanti cm dovrebbero corrispondere?
Domenico
Win 10 - Excel 2016
Post: 704
Registrato il: 28/12/2009
Città: CITTADELLA
Età: 62
Utente Senior
excel 2007/365
OFFLINE
11/12/2016 11:31

Nel file postatato è solo un esempio, comunque corrispondono a 8 - 18 - 28 mm (0,8 - 1,8 - 2,8cm).
Con varie prove il calcolo più esatto lo fa questa macro:
'Sub rigacolonna()
    'Selection.RowHeight = (295.2 / 100) * 10 'riga
    'Selection.ColumnWidth = (45.9 / 100) * 10 'colonna
    'End Sub


il 10 nella macro corrisponde all'altezza (riga) o larghezza (colonna) desiderata.
max
[Modificato da maxma62 11/12/2016 12:47]
____________________________
versione excel 365 ufficio
versione excel 2007 casa
Vota:
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Cerca nel forum
Tag discussione
Discussioni Simili   [vedi tutte]
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 08:40. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com