Ah, now we are getting somewhere. This is the first time you said
anything about trying to write a macro. It is still not clear where the
original data resides that you are trying to abstract, nor how you
identify which cells contain the date and import information.
Assuming that you want to abstract information from all worksheets
within a particular workbook, whose name has been assigned to the VBA
variabile named "yourWorkbook", and assuming (as previously, since you
never contraticted that assumption) that date is the only numeric value
in C50:C80 and import is the only numberic value in D50
80, then you
could substitute in your code
inizio = Selection.Row
If inizio > 60000 Then inizio = 1
i = 0
For Each sh In Workbooks(yourWorkbook).Worksheets
i = i + 1
Cells(inizio + i, 1) = sh.Name
Cells(inizio + i, 2) = WorksheetFunction.Max(sh.[C50:C80])
Cells(inizio + i, 2).NumberFormat = "m/d/yy"
Cells(inizio + i, 4) = WorksheetFunction.Max(sh.[D50
90])
Next
If there are other numeric values in those ranges, then you could set up
loops to examine cell contents and identify (based on criteria you have
yet to disclose) which cells contain the information you want.
If don't want all worksheets in a particular workbook, but can construct
sheet names from your index number (as in Sheet1, Sheet2, ...), then you
could change the loop such as
inizio = Selection.Row
If inizio > 60000 Then inizio = 1
For i = 1 To Righe
Set sh = Workbooks(yourWorkbook).Worksheets("Sheet" & i)
... (as above)
Next
Jerry
Dear Sir Jerry.
Please i need for my job to modify my PC program:
Sub ArchiviaDoc()
'
' ArchiviaDocumento Macro
'
Dim DataDoc As Date
Dim i, Righe As Integer
Dim ConPag As Currency
DataDoc = Cells(21, 4)
Righe = 1
ConPag = Cells(85, 7)
Sheets("arch_doc").Select
Cells(1, 1).Select
Range("a1").End(xlDown).Select
inizio = Selection.Row
If inizio > 60000 Then inizio = 1
For I = 1 To Righe
Cells(inizio + I, 1) = 1(Comeback the name page(for example: sheet 100;
sheet101, sheet 102, etc.)
Cells(inizio + I, 2) = DataDoc
Cells(inizio + I, 4) = ConPag (C85:C90 [ConPag = Cells(85, 7)])
Next I
Cells(inizio + I - 1, 1).Select
End Sub
1-I need that comeback the name page(for example: sheet 100; sheet101, sheet
102, etc.)
2-The amount must be between C85:C90 [ConPag = Cells(85, 7)]
3-Also if i add a new page the program work well with the new page.
Regards
Marcello
Why are the suggestions that I made in my previous post not acceptable?
Lack of response usually means that your post was unclear. Repeating the
same question without additional information does nothing to resolve that
situation.
Jerry
SM wrote: