use VB code IF to automate filling in 11 columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I used belowed VB code IF to automate fill in 11 columns:

If Cells(p, "D").Value >= DateValue("01/01/2005") Then
a = Cells(p, "H").Value
b = Cells(p, "A").Value
............

The first ten work pretty well, but the last one, 11 one fails. Is it the
reason that IF in VB only allows ten variance? Thanks.
 
Use a Select Case statement instead (Psuedo code)

Select Case Cells(p, "D").Value
Case Is >= 'Conditions here
'More Case Statements
Case Else
End Select

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 

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

Similar Threads


Back
Top