Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:02:55+00:00 2026-06-13T18:02:55+00:00

UPDATE: Got a new issue with a formula, can’t quite get it to work

  • 0

UPDATE:
Got a new issue with a formula, can’t quite get it to work because of text in the formula, the formula (as taken from excel) should be,

=IF(D2<=0,"No Sales Price",E2/D2)  

I have tried as many combinations as I can think of but the “no sales price” is causing an issue with the quotation marks. My current code is

For i = 2 To LastRowG   
Range("Q" & i).Formula = "=IF(D" & i & "<=0," & "(No Sales Price)",  & "(E" & i & "/D" & i & "))"    
Next i  

have had a look around but been unable to see any resolutions to the problem, any enlightenment will be met with the greatest appreciation

EDIT:This was fixed by inserting the following lines;

For i = 2 To LastRowG  
Range("Q" & i).Formula = "=IF(D" & i & "<=0," & Chr(34) & "No Sales Price" & Chr(34) & "," & "E" & i & "/" & "D" & i & ")"
Next i 

The Chr(34) inserts the ASCII character appertaining to that number which just so happens to be “. The program doesn’t read it as having typed in the quote marks and continues to read the line of code correctly but then places the “no sales price” correctly in the formula.

It will output the line as the formula is intended to be and the Chr(34) is like writing “”No Sales Price”” without the inevitable “expected end of statement” error

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:03:01+00:00Added an answer on June 13, 2026 at 6:03 pm

    What I suggested will result in something like this:

    LastRow = Cells(Rows.Count, "C").End(xlUp).Row
    Cells(LastRow + 1, 3).Formula = "=SUM(C1:C" & LastRow & ")"
    

    Extra 1

    Is it possible to use this formula to enter the word Total in the cell to the left?

    Range("B" & LastRow + 1) = "Total"
    

    Extra 2

    One more just to push my luck, how about copying a formula all the way down a column the the last cell? =G2*57.5 copied until the last row in I

    LastRowG = Cells(Rows.Count, "G").End(xlUp).Row
    
    For i = 2 To LastRowG
        Range("I" & i).Value = "=G" & i & "*57.5"
    Next i
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got some weird behavior and I can only assume is because of the
Update: Got this working by disabling CodeIgniter Profiler which was interfering with the Ajax
I've started working with ASP.net AJAX (finally ☺). and I've got an update panel
I've got rejected my recent update on iPhone app and it says: When file
I've got a case statement: UPDATE Answer SET AnswerID = @AnswerID, AnsweredBy = CASE
Update 3 : Never mind. I kinda got what I was looking for. The
I've got about 25 tables that I'd like to update with random data that's
I've got the following type of SQL: UPDATE photo AS f LEFT JOIN car
UPDATE: SOLVED Hi all, i've got it, just save cookie to temp file, and
I've got an Ant task that when launched will update the version number in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.