Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
newbie04,
Comments in line. Also, what errors are you getting ? NickHK "newbie04 " wrote in message ... Sub testing() z = 0 For m = 3 To Sheets.Count For i = 6 To 200 '---- Use With Worksheets(m) to tidy the code -------- If Worksheets(m).Cells(i, 15) = Worksheets(m).Cells(i + 1, 15) Then z = z + 1 Else '------ Not needed as you tested this above and must be true to reach re -- If Worksheets(m).Cells(i, 15) < Worksheets(m).Cells(i + 1, 15) And Worksheets(m).Cells(i, 1) < "" Then Worksheets(m).Rows(i + 1).Font.Bold = True Worksheets(m).Cells(i + 1, 9) = "=SUM(I" & (i - z) & ":I" & i & ")" Worksheets(m).Cells(i + 1, 10) = "=SUM(J" & (i - z) & ":J" & i & ")" Worksheets(m).Cells(i + 1, 11) = "=SUM(K" & (i - z) & ":K" & i & ")" Worksheets(m).Cells(i + 1, 13) = "=SUM(M" & (i - z) & ":M" & i & ")" z = 0 End If End If Next i Next m End Sub Here's the code. i seem alrite to run in single sheet, but errors happen when it has to do the task over several sheets. I guess the error are the SUM.... as it is not defined which column to be taken from the sheets. So how i can solve this? Thks. --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
divide column(x) by column(y) to give column(x/y) in excel? | New Users to Excel | |||
Referencing date column A & time column B to get info from column | Excel Discussion (Misc queries) | |||
Return text in Column A if Column B and Column K match | Excel Worksheet Functions | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Discussion (Misc queries) | |||
what formula do i put for column m = column k minus column l in e. | Excel Discussion (Misc queries) |