LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loop to excute data


I try to modify the code below to copy data from column 1 cell value
if next column 2 cell value is numeric and paste it to column 3. Also
i try to assign "Activecell" to the assign column where data to be cop
and paste. Hope someone in this forum may assist me to solve thi
problem.

'From (before modify):
Sub Loop()
Do :
If IsEmpty(ActiveCell) Then
If IsEmpty(ActiveCell.Offset(0, -1)) Then
ActiveCell.Value = ""
Else
ActiveCell.FormulaR1C1 = "=(RC[-2])"
End If
End If
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -2))
End Sub

'to (after modify):

Sub Loop2()
Dim N As Integer
Dim Celcal1 As Integer
Dim cell1 As Object

Celcal1 = Range("A1").CurrentRegion.Rows.Count
For N = 1 To Celcal1
Set cell1 = Cells(N, 3)

Do
If IsEmpty(cell1) Then
If IsEmpty(cell1.Offset(0, -1)) Then
cell1.Value = ""
Else
cell1.FormulaR1C1 = "=(RC[-2])"
End If
End If
cell1.Offset(1, 0).Select
Loop Until IsEmpty(cell1.Offset(0, -2))
Next N
End Sub

:confused

--
VBNewbi
-----------------------------------------------------------------------
VBNewbie's Profile: http://www.excelforum.com/member.php...fo&userid=3652
View this thread: http://www.excelforum.com/showthread.php?threadid=56277

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
End of data loop mortals Excel Programming 4 December 21st 05 10:13 PM
Need help with loop to import data silvest Excel Programming 1 September 23rd 04 03:16 PM
Need help with loop to import data silvest[_2_] Excel Programming 0 September 23rd 04 03:16 PM
error to excute cut or copy in vba programming Netstar Excel Programming 2 September 22nd 04 02:11 AM
Excute a Excel worksheet with Task Scheduler Randy[_15_] Excel Programming 0 September 8th 04 01:53 PM


All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"