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 8379943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:19:25+00:00 2026-06-09T16:19:25+00:00

Got a trouble in a VBA excel program. Sub code(s) … code = t

  • 0

Got a trouble in a VBA excel program.

Sub code(s)
...
code = t
End Sub

And then :

Sub CommandButton1_Click()
...
For i = 0 To size
    current_y = code(string_array(i))
...
End Sub

When i run the program, i got this error “Variables are required” (not sure, i’m working on a japanese version of excel). Sub CommandButton1_Click is highlighted and code is selected inside CommandButton1_Click. Can’t figure out why, though it must be simple…

  • 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-09T16:19:27+00:00Added an answer on June 9, 2026 at 4:19 pm

    You’re trying to return a result from a Sub. Try declaring it as a function instead, as this is able to return values to the caller:

    Function code(s)
    ...
    code = t
    End Function 
    

    If it makes it any clearer, on my English version the error message is:

    Expected Function or variable

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got some trouble with my preg_match. The code. $text = tel: 012 213 123.
I've got trouble on how to print my hash contents. Code snippet as this,
I've got a program that's having some trouble during shutdown, raising exceptions that I
I'm having trouble executing a stored proc... I've got C# code that tries to
I'm using jade's mixin and got some trouble: code: mixin renderLink(linkName,linkUrl,linkClass,other) - var active
I got trouble on Member Description show up. For example, I have two laptops.
Why have I got trouble with charset on echo? $url = http://ru.wikipedia.org; $site=file_get_contents($url); echo
i'v got a trouble, i want to use Ckeditor with my project, i have
I've got a real trouble now. I've got my win Application and a lot
Got a crash report from a beta tester and I'm having trouble identifying the

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.