VBA error in Excel: Invalid Use of Property -


I've written the code at CommandButton_Click () , but it returns the following error:

/ P>

Error Compiled: Invalid use of property.

  Folk Sub SectorName () as a slow score string, the result of integer as integer as an integer = 1 to 473 score = category ( "AB" + a_counter). If the score = "Technology and FM" then results = "25" als score = "operating equipment and supplies" then results = "26" als score = "interior and design" followed by result = "27" als score = "outdoor And Result Experience "then Results =" 28 "Els Score =" Horaco "then Results =" 29 "Els Score =" Retail and Franchise "Then Results =" 30 "Els Score =" Design "Then Results =" 33 "Els Score = "Health and Fitness Exits, P & S" After Results = "32" Else score = "Entertaining fun and am p; Adventure" then result = "31" or the result = "35" category ("AC" + a_counter) Price End If Next a_counter End sub  

please help me find a solution.

You have some minor problems:

  1. Getting on:

      Range ("AC" + a_counter). Value  

    I believe you have to:

      range ("AC" + a_counter). Value = result  
  2. This: range ("AB" + a_counter) and this: range ("AC" A_counter) should use & amp; and not + to add the strings, otherwise you will be able to enter the and range ("AC" and )

  3. < Li>

    I have just edited your question and with better indentation, I have also noticed that your is the end if is < Strong> after range ("AC" + a_counter). Value should be first , otherwise your result will be specified in the Other case and not for anyone else.

Therefore, your last code should look like this:

  public sub region name () String as a slow score, result round As integer as integer, a_counter = 1 to 473 score = range ("AB" and "a_counter"). If the score = "Technology and FM" then results = "25" als score = "operating equipment and supplies" followed by result = "26" als score = "interior and design" then results = "27" als score = "outdoor "Result =" 28 "Else score =" Horaco "then Results =" 29 "Els Score =" Retail and Franchise "Then Results =" 30 "Els Score =" Design "Then Results =" 33 "Els Score = "Health and Fitness Eqpts, P & S", then W Reason = "32" Els Score = "Entertainment Fun and Adventure" Then R Esult = "31" Other Results = "35" End If Range ("AC" & A_counter) Value = results next a_counter termination sub  

Now you should work as expected.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -