Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi, i need a macro to look in column B for a date ( 12/01 ) and then to add
the date to column A till last filled cell in A. EX: (this is now) A B 12/01 1 07:53:20 2 07:53:21 3 07:53:22 4 08:01:21 5 08:01:31 6 08:01:32 12/02 8 08:01:36 9 08:01:38 10 08:14:04 11 08:14:09 Ex: (after macro) 12/01 01.12.2009 07:53:20 01.12.2009 07:53:21 01.12.2009 07:53:22 01.12.2009 08:01:21 01.12.2009 08:01:31 01.12.2009 08:01:32 12/02 02.12.2009 08:01:36 02.12.2009 08:01:38 02.12.2009 08:14:04 02.12.2009 08:14:09 If in column A is a blank cell, in next cell in column B is a date. Can this be done? Thanks! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try the below
Sub Macro() Dim lngRow As Long, varDate As Variant For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row If Range("A" & lngRow) = "" Then varDate = Range("B" & lngRow) Else Range("A" & lngRow) = varDate End If Next End Sub -- Jacob "puiuluipui" wrote: Hi, i need a macro to look in column B for a date ( 12/01 ) and then to add the date to column A till last filled cell in A. EX: (this is now) A B 12/01 1 07:53:20 2 07:53:21 3 07:53:22 4 08:01:21 5 08:01:31 6 08:01:32 12/02 8 08:01:36 9 08:01:38 10 08:14:04 11 08:14:09 Ex: (after macro) 12/01 01.12.2009 07:53:20 01.12.2009 07:53:21 01.12.2009 07:53:22 01.12.2009 08:01:21 01.12.2009 08:01:31 01.12.2009 08:01:32 12/02 02.12.2009 08:01:36 02.12.2009 08:01:38 02.12.2009 08:14:04 02.12.2009 08:14:09 If in column A is a blank cell, in next cell in column B is a date. Can this be done? Thanks! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Jacob. It's working great!
But after the macro i will need to search for empty cells in A column and detele entire row. Can this be done? Thanks allot! "Jacob Skaria" a scris: Try the below Sub Macro() Dim lngRow As Long, varDate As Variant For lngRow = 1 To Cells(Rows.Count, "A").End(xlUp).Row If Range("A" & lngRow) = "" Then varDate = Range("B" & lngRow) Else Range("A" & lngRow) = varDate End If Next End Sub -- Jacob "puiuluipui" wrote: Hi, i need a macro to look in column B for a date ( 12/01 ) and then to add the date to column A till last filled cell in A. EX: (this is now) A B 12/01 1 07:53:20 2 07:53:21 3 07:53:22 4 08:01:21 5 08:01:31 6 08:01:32 12/02 8 08:01:36 9 08:01:38 10 08:14:04 11 08:14:09 Ex: (after macro) 12/01 01.12.2009 07:53:20 01.12.2009 07:53:21 01.12.2009 07:53:22 01.12.2009 08:01:21 01.12.2009 08:01:31 01.12.2009 08:01:32 12/02 02.12.2009 08:01:36 02.12.2009 08:01:38 02.12.2009 08:14:04 02.12.2009 08:14:09 If in column A is a blank cell, in next cell in column B is a date. Can this be done? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
need help to update macro to office 2007 macro enabled workbook | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |