Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a column with dates and times. I want to take the
date out. So I'm doing it like this: For each Cell in ActiveSheet.Range("A2:A10000") Cell.Value = Cell.Value - Int(Cell.Value) Next Cell This works, but it adds minutes to the procedure. Is there a statement or other that will just make the change to the entire range at once? tod |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
one way:
Dim vArr As Variant Dim i As Long With ActiveSheet.Range("A2:A10000") vArr = .Value For i = 1 To UBound(vArr) vArr(i, 1) = Int(vArr(i, 1)) Next i .Value = vArr End With In article , "Tod" wrote: I have a column with dates and times. I want to take the date out. So I'm doing it like this: For each Cell in ActiveSheet.Range("A2:A10000") Cell.Value = Cell.Value - Int(Cell.Value) Next Cell This works, but it adds minutes to the procedure. Is there a statement or other that will just make the change to the entire range at once? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wow! Big difference. Thanx.
-----Original Message----- one way: Dim vArr As Variant Dim i As Long With ActiveSheet.Range("A2:A10000") vArr = .Value For i = 1 To UBound(vArr) vArr(i, 1) = Int(vArr(i, 1)) Next i .Value = vArr End With In article , "Tod" wrote: I have a column with dates and times. I want to take the date out. So I'm doing it like this: For each Cell in ActiveSheet.Range("A2:A10000") Cell.Value = Cell.Value - Int(Cell.Value) Next Cell This works, but it adds minutes to the procedure. Is there a statement or other that will just make the change to the entire range at once? . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tod,
Using the worksheet is a good way: If column B is blank: With ActiveSheet.Range("B2:10000") .Formula = "=A2-INT(A2)" .Copy Range("A2:A10000").PasteSpecial (xlValues) .Clear End With -- HTH, Bernie MS Excel MVP "Tod" wrote in message ... I have a column with dates and times. I want to take the date out. So I'm doing it like this: For each Cell in ActiveSheet.Range("A2:A10000") Cell.Value = Cell.Value - Int(Cell.Value) Next Cell This works, but it adds minutes to the procedure. Is there a statement or other that will just make the change to the entire range at once? tod |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change values in a column | Excel Discussion (Misc queries) | |||
How can I change all negative values in a column to = 0? | Excel Worksheet Functions | |||
macro to change multiple values in a column | Excel Discussion (Misc queries) | |||
Change all values in an excel column at once? | Excel Discussion (Misc queries) | |||
How do I apply a Function to a column of cells and change there va | New Users to Excel |