Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Convert to Excel Macro

Hi all, I need some help here.

I need this logic converted to an excel 2003 macro:

Current worksheet
Do x = 1 (until there is no more data in column A)
If the value of cell Ax cell Bx then cell Bx = cell Ax
If the value of cell Ax < cell Cx then cell Cx = cell Ax
x = x + 1
End Do

All my attempts fail.
Thanks,
Wes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Convert to Excel Macro

hi Wes,

Sub Macro1()
Dim LastRow As Long, i As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
For i = 1 To LastRow
If .Range("A" & i) .Range("B" & i) Then
.Range("B" & i) = .Range("A" & i).Value
ElseIf .Range("A" & i) < .Range("B" & i) Then
.Range("C" & i) = .Range("A" & i).Value
Else
'what is equal
End If
Next
End With
End Sub

isabelle

Le 2013-03-04 21:34, Wes Finch a écrit :
Hi all, I need some help here.

I need this logic converted to an excel 2003 macro:

Current worksheet
Do x = 1 (until there is no more data in column A)
If the value of cell Ax cell Bx then cell Bx = cell Ax
If the value of cell Ax < cell Cx then cell Cx = cell Ax
x = x + 1
End Do

All my attempts fail.
Thanks,
Wes

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Convert to Excel Macro

On Monday, March 4, 2013 10:14:29 PM UTC-5, isabelle wrote:
hi Wes,



Sub Macro1()

Dim LastRow As Long, i As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, 1).End(xlUp).Row

For i = 1 To LastRow

If .Range("A" & i) .Range("B" & i) Then

.Range("B" & i) = .Range("A" & i).Value

ElseIf .Range("A" & i) < .Range("B" & i) Then

.Range("C" & i) = .Range("A" & i).Value

Else

'what is equal

End If

Next

End With

End Sub



isabelle



Le 2013-03-04 21:34, Wes Finch a écrit :

Hi all, I need some help here.




I need this logic converted to an excel 2003 macro:




Current worksheet


Do x = 1 (until there is no more data in column A)


If the value of cell Ax cell Bx then cell Bx = cell Ax


If the value of cell Ax < cell Cx then cell Cx = cell Ax


x = x + 1


End Do




All my attempts fail.


Thanks,


Wes




Thanks isabelle,
This works great!
You have saved me much stress.
Wes
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Convert to Excel Macro

glad to help. thanks for the feedback.

isabelle

Le 2013-03-04 22:34, Wes Finch a écrit :

Thanks isabelle,
This works great!
You have saved me much stress.
Wes

Reply
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
Lotus macro i need to convert to Excel Sammy Excel Discussion (Misc queries) 4 April 28th 10 09:31 PM
macro to convert excel to PDF EricBB Excel Discussion (Misc queries) 2 March 18th 09 04:03 PM
writing macro to convert excel to pdf matt Excel Discussion (Misc queries) 5 February 23rd 07 12:50 AM
convert a Word macro to an Excel macro jsd219 Excel Programming 32 October 27th 06 03:58 PM
Convert excel 5.0 macro Staes Jan Excel Programming 1 October 20th 04 01:00 PM


All times are GMT +1. The time now is 10:54 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"