Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sir,
I am getting daily an excel file with data which varies every day. I have recorded a macro to check the data which is given below: Sub checktime() Range("D1").Select Selection.EntireColumn.Insert Range("D1").Select ActiveCell.FormulaR1C1 = "TTime" Range("D2").Select ActiveCell.FormulaR1C1 = _ "=AND(RC[-1]=--LEFT(RC[8],5),RC[-1]<=--RIGHT(RC[8],5))" Range("D2").Select Selection.Copy Range("D3:D721").Select ActiveSheet.Paste Application.CutCopyMode = False Range("D1").Select End Sub my problem is that, I want to paste the copied cell("D2") down till the row in which there is data in column C. please provide a modification in the code to accommodate the the above. thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this version:
LastRowInC = Range("C" & Rows.Count).End(xlUp).Row Range("D3:D" & LastRowInC).Select Sub checktime() Range("D1").Select Selection.EntireColumn.Insert Range("D1").Select ActiveCell.FormulaR1C1 = "TTime" Range("D2").Select ActiveCell.FormulaR1C1 = _ "=AND(RC[-1]=--LEFT(RC[8],5),RC[-1]<=--RIGHT(RC[8],5))" LastRowInC = Range("C" & Rows.Count).End(xlUp).Row Range("D2").Select Selection.Copy Range("D3:D" & LastRowInC).Select ActiveSheet.Paste Application.CutCopyMode = False Range("D1").Select End Sub Regards, Stefi €˛shaji€¯ ezt Ć*rta: Sir, I am getting daily an excel file with data which varies every day. I have recorded a macro to check the data which is given below: Sub checktime() Range("D1").Select Selection.EntireColumn.Insert Range("D1").Select ActiveCell.FormulaR1C1 = "TTime" Range("D2").Select ActiveCell.FormulaR1C1 = _ "=AND(RC[-1]=--LEFT(RC[8],5),RC[-1]<=--RIGHT(RC[8],5))" Range("D2").Select Selection.Copy Range("D3:D721").Select ActiveSheet.Paste Application.CutCopyMode = False Range("D1").Select End Sub my problem is that, I want to paste the copied cell("D2") down till the row in which there is data in column C. please provide a modification in the code to accommodate the the above. thanks |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
it is working great.
thanks "Stefi" wrote: Try this version: LastRowInC = Range("C" & Rows.Count).End(xlUp).Row Range("D3:D" & LastRowInC).Select Sub checktime() Range("D1").Select Selection.EntireColumn.Insert Range("D1").Select ActiveCell.FormulaR1C1 = "TTime" Range("D2").Select ActiveCell.FormulaR1C1 = _ "=AND(RC[-1]=--LEFT(RC[8],5),RC[-1]<=--RIGHT(RC[8],5))" LastRowInC = Range("C" & Rows.Count).End(xlUp).Row Range("D2").Select Selection.Copy Range("D3:D" & LastRowInC).Select ActiveSheet.Paste Application.CutCopyMode = False Range("D1").Select End Sub Regards, Stefi €˛shaji€¯ ezt Ć*rta: Sir, I am getting daily an excel file with data which varies every day. I have recorded a macro to check the data which is given below: Sub checktime() Range("D1").Select Selection.EntireColumn.Insert Range("D1").Select ActiveCell.FormulaR1C1 = "TTime" Range("D2").Select ActiveCell.FormulaR1C1 = _ "=AND(RC[-1]=--LEFT(RC[8],5),RC[-1]<=--RIGHT(RC[8],5))" Range("D2").Select Selection.Copy Range("D3:D721").Select ActiveSheet.Paste Application.CutCopyMode = False Range("D1").Select End Sub my problem is that, I want to paste the copied cell("D2") down till the row in which there is data in column C. please provide a modification in the code to accommodate the the above. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |