Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am looking for code to do the following: If cells J, K, L, & M are empty then move cells "E" to "D" and "H" t "G". I need to do this on records 1-9999. Thanks, Me -- Metraza ----------------------------------------------------------------------- Metrazal's Profile: http://www.excelforum.com/member.php...fo&userid=3164 View this thread: http://www.excelforum.com/showthread.php?threadid=51839 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Metrazal,
Try this. Where I entered this formula in Column I and pulled down. =COUNTA(J1:M1) If column I is not usable then any free column will do, just chang the code to reflect the other column instead of I1 and I100. Sub IfEmptyMoveIt() Dim i As Integer Range("I1").Select For i = 1 To Range("I100").End(xlUp).Row If ActiveCell.Value = 0 Then ActiveCell.Offset(, -4).Cut ActiveCell.Offset(, -5) ActiveCell.Offset(, -1).Cut ActiveCell.Offset(, -2) End If ActiveCell.Offset(1, 0).Select Next End Sub HTH Regards, Howard "Metrazal" wrote in message ... I am looking for code to do the following: If cells J, K, L, & M are empty then move cells "E" to "D" and "H" to "G". I need to do this on records 1-9999. Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=518398 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() It seems to move the data regardless if data is in cells j:m and it seems to stop at about 94 records. Any ideas? Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=518398 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Got it to work. I previously did not enter the calculation data in column A. Thanks.. However, its very slow.. Does anyone know of a faster way to achieve this? Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=518398 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Met,
I revised the code to a For each cell in Range/Next and it took about 11 seconds to do 11,000 rows. Is that faster than what than what you have? Regards, Howard "Metrazal" wrote in message ... I am looking for code to do the following: If cells J, K, L, & M are empty then move cells "E" to "D" and "H" to "G". I need to do this on records 1-9999. Thanks, Met -- Metrazal ------------------------------------------------------------------------ Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648 View this thread: http://www.excelforum.com/showthread...hreadid=518398 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Moving text around cells without moving boarder lines | Excel Discussion (Misc queries) | |||
Enter Key + Dragging Cells / Moving Cells | Excel Discussion (Misc queries) | |||
Arrow Keys Moving Window Frame instead of Moving Between Cells | Excel Discussion (Misc queries) | |||
Moving cells | Excel Worksheet Functions | |||
Cells(col,row) keep moving to lower case and I can not ref. a cells in a differnet sheet | Excel Programming |