OilEconomist
Active Member
- Joined
- Dec 26, 2016
- Messages
- 417
- Office Version
-
- 2019
- Platform
-
- Windows
Thanks in advance and I will let you know if the assistance/recommendation works.
I have a loop that goes from the second to the last row.
In one column I have a counter that works (Cells(n, 7) = n - 1) as it goes from 2 to the lastrow.
I also want to calculate the following formulas and paste special values after they calculate. I know you can do this without a loop, but there are some other items I'm also doing in the loop so I would like to keep the loop. In your recommendation, please give one where I can use the loop.
Also, note that I am combining some text and entries of cells so that seems to be an issue.
Column H
=G2&". "&C2
Column I
="Document No.: "&D2
Column J
="Amount: "&TEXT(E2,"$#,##0")
Column M
="ren "&""""&G2&""""&" "&""""&G2&". "&C2&" - "&D2&" - "&TEXT(E2,"$#,##0")&""""
This is the code for my loop. I just need the code for these three lines and yes there is a reason to have the "" after executed (i.e. I want the test to be in quotes where indicated such as "Text").
Thanks!
I have a loop that goes from the second to the last row.
In one column I have a counter that works (Cells(n, 7) = n - 1) as it goes from 2 to the lastrow.
I also want to calculate the following formulas and paste special values after they calculate. I know you can do this without a loop, but there are some other items I'm also doing in the loop so I would like to keep the loop. In your recommendation, please give one where I can use the loop.
Also, note that I am combining some text and entries of cells so that seems to be an issue.
Column H
=G2&". "&C2
Column I
="Document No.: "&D2
Column J
="Amount: "&TEXT(E2,"$#,##0")
Column M
="ren "&""""&G2&""""&" "&""""&G2&". "&C2&" - "&D2&" - "&TEXT(E2,"$#,##0")&""""
This is the code for my loop. I just need the code for these three lines and yes there is a reason to have the "" after executed (i.e. I want the test to be in quotes where indicated such as "Text").
Thanks!
Code:
Sub Formulas()
Dim n as Integer
Dim LastRow12 as Long
For n = 2 To LastRow12
Cells(n, 7) = n - 1
Next n
End Sub