Pls. Help with Macro!!!!

  • Thread starter Thread starter lovebaby
  • Start date Start date
L

lovebaby

I'm trying to create a macro that will execute the funcyion below on a
three columns of data (C, E,F). The columns can vary in length from 26
to 60+ entries.

How do go about doing this?


=IF(E2=0,"? RT = "&TEXT(F2,"###.00"),C2)


Any help is very much appreciated.
 
lovebaby said:
I'm trying to create a macro that will execute the funcyion below on a
three columns of data (C, E,F). The columns can vary in length from 26
to 60+ entries.

How do go about doing this?


=IF(E2=0,"? RT = "&TEXT(F2,"###.00"),C2)


Any help is very much appreciated.

I don't understand, why do you need a macro?
 
The operation below is just of about 60 operations it takes us to go
from raw to presentable data.

We need a macro to totally automate this. It is a time consuming and
non-productive waste of time for us to do these manually. We do about
100 sheets like this a week.
 
You didn't say where this formula would go.

You didn't say how you determine the rows to put it in (row 2 to ???).

But this may give you an idea...

Option Explicit
Sub testme()

Dim LastRow As Long

With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
With .Range("G2:G" & LastRow)
.Formula = "=IF(E2=0,""? RT = ""&TEXT(F2,""###.00""),C2)"
'do you want to keep the formua or convert to values?
'.Value = .Value
End With
End With

End Sub

I stuck it in column G (G2 through the last row used in column A).
 
I want the operation (formula) to take place in Column A. I need to
populate A using data from columns C,E, and F. I just need the data; I
wouldn't need the formula to remain, afterwords.
 
And you find the last row how????
I want the operation (formula) to take place in Column A. I need to
populate A using data from columns C,E, and F. I just need the data; I
wouldn't need the formula to remain, afterwords.
 
I don't how. Every spreadsheet generated can be different from 30 to 60
entries.

I ther no way Excel can determine how big my array is and perform the
operations on what is there?
 
Can you pick out a column that's always has something in it.

If you can, then you can modify the suggestion like:

Option Explicit
Sub testme()

Dim LastRow As Long

With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
With .Range("A2:A" & LastRow)
.Formula = "=IF(E2=0,""? RT = ""&TEXT(F2,""###.00""),C2)"
'do you want to keep the formua or convert to values?
.Value = .Value
End With
End With

End Sub

Just change the X to that column letter in this line:
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row


I don't how. Every spreadsheet generated can be different from 30 to 60
entries.

I ther no way Excel can determine how big my array is and perform the
operations on what is there?
 
thanks, I'll try it.


Dave said:
Can you pick out a column that's always has something in it.

If you can, then you can modify the suggestion like:

Option Explicit
Sub testme()

Dim LastRow As Long

With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
With .Range("A2:A" & LastRow)
.Formula = "=IF(E2=0,""? RT = ""&TEXT(F2,""###.00""),C2)"
'do you want to keep the formua or convert to values?
.Value = .Value
End With
End With

End Sub

Just change the X to that column letter in this line:
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top