pasting formula with Visual basic

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hi all,
I'm trying to paste the following formula using visual basic

=IF(GSTStatus="GST",Credit+Debit)/GSTDivideBy,)
(the GSTStatus, Credit, Debit and GSTDivideBy are all difined names)

To do this I have tried this but the "GST" part won't let me.
ActiveCell.Offset(1, -9) = "=IF(GSTStatus="GST",Credit+Debit)/GSTDivideBy,)"

Any clues?

Rob
 
Hi Rob,

You need to double up yhe quotes used within your formula.
 
Hi Norman,

I couldn't get your reply through OE for some reason and found it using
Google.
After I posted my question, about 1 second later, I realised that I could
make the whole formula a defined name and paste it using VBA without a
problem. But I'll remember your solution as well....so thanks!!

Rob
 

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