Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
smart.daisy
 
Posts: n/a
Default use VB code IF to automate filling in 11 columns

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.


  #2   Report Post  
Posted to microsoft.public.excel.misc
Nick Hodge
 
Posts: n/a
Default use VB code IF to automate filling in 11 columns

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
HIS


"smart.daisy" wrote in message
...
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
code not unique find latest date Barbara Wiseman Excel Discussion (Misc queries) 3 December 11th 05 08:50 AM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM


All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"