Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
i have tried to put a chunk of code ... but i m unable
to make it fit as per my problem. can u help me out! My scenario is as follows: PunchDate DateIn Timein DateOut Timeout Shift Dept Reg LCh OT DT BR Total HWH Abst Remarks The above r the columns of the Excel report generated, i have shown them in 2 rows, otherwise all these columns r in one row only and r generated from A-Q in Excel sheet. i want the condition to be enforced on TimeIn column and display the result of the condition in a new column which shud be generated after the last columns i.e. 'Remarks' . And Also it shud affect all the roecords till the end of the sheet! i tried to put on a code... but i cudn't make it! i m doin like this... i know i m doin something stupid. Dim MyCell As Object For Each MyCell In Range(Cells(3, 7), Cells(3, 7).End(xlDown)).Cells If MyCell.Value TimeSerial(10, 0, 0) Then MyCell.Offset(0, 1).Value = TimeSerial(11, 0, 0) Else MyCell.Offset(0, 1).Value = "" End If Next please help me out! thanx n regards Inder |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Slightly confused about columns but try this ...
Dim lastrow As Long Dim irow As Long lastrow = Cells(Rows.Count, "A").End(xlUp).Row For irow = 2 To lastrow If Cells(irow, "C") TimeSerial(10, 0, 0) Then Cells(irow, "R") = TimeSerial(11, 0, 0) Else Cells(irow, "R").Value = "" End If Next irow "Inder" wrote: i have tried to put a chunk of code ... but i m unable to make it fit as per my problem. can u help me out! My scenario is as follows: PunchDate DateIn Timein DateOut Timeout Shift Dept Reg LCh OT DT BR Total HWH Abst Remarks The above r the columns of the Excel report generated, i have shown them in 2 rows, otherwise all these columns r in one row only and r generated from A-Q in Excel sheet. i want the condition to be enforced on TimeIn column and display the result of the condition in a new column which shud be generated after the last columns i.e. 'Remarks' . And Also it shud affect all the roecords till the end of the sheet! i tried to put on a code... but i cudn't make it! i m doin like this... i know i m doin something stupid. Dim MyCell As Object For Each MyCell In Range(Cells(3, 7), Cells(3, 7).End(xlDown)).Cells If MyCell.Value TimeSerial(10, 0, 0) Then MyCell.Offset(0, 1).Value = TimeSerial(11, 0, 0) Else MyCell.Offset(0, 1).Value = "" End If Next please help me out! thanx n regards Inder |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Last Modified date on cell or column | Excel Discussion (Misc queries) | |||
Modified:- Macro to Generate a new Column!!! | Excel Worksheet Functions | |||
Macro to generate a new column denpending upon existing one! | Excel Worksheet Functions | |||
In Excel can you have a cell generate the last dated modified?? | Excel Discussion (Misc queries) | |||
How to record macro to print pages modified today | Excel Worksheet Functions |