Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Hi folks

Hi folks

Scheduled Pinned Locked Moved Visual Basic
helptutorial
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Matthew Leggett
    wrote on last edited by
    #1

    I need to pass a variable from one procedure to another in visual basic, can anyone help me by sending me a small example

    V 1 Reply Last reply
    0
    • M Matthew Leggett

      I need to pass a variable from one procedure to another in visual basic, can anyone help me by sending me a small example

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      What Version of Vb are you using (Hope not vb6), because i have no plan in helping you if you still use that(vb6 is dead). Explain Exacly what you want and by showing us what have you done so far, lets see your code or you Procedure.

      Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

      L 1 Reply Last reply
      0
      • V Vimalsoft Pty Ltd

        What Version of Vb are you using (Hope not vb6), because i have no plan in helping you if you still use that(vb6 is dead). Explain Exacly what you want and by showing us what have you done so far, lets see your code or you Procedure.

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Just because a language is no longer supported by its maker does not mean it is dead. A language is "dead" when no one uses it anymore. There are plenty of legacy applications written in Visual Basic 6 that I'm sure will need to be updated in the years to come.

        Private Sub A (ByVal Param As String)
        ' Do something with Param
        End Sub

        To pass it, call A("string").

        M 1 Reply Last reply
        0
        • L Lost User

          Just because a language is no longer supported by its maker does not mean it is dead. A language is "dead" when no one uses it anymore. There are plenty of legacy applications written in Visual Basic 6 that I'm sure will need to be updated in the years to come.

          Private Sub A (ByVal Param As String)
          ' Do something with Param
          End Sub

          To pass it, call A("string").

          M Offline
          M Offline
          Matthew Leggett
          wrote on last edited by
          #4

          Hi Private Sub Month_Click() Worksheets(SetMonth).Range("M1").Select Count6 = 0 Do Count6 = Count6 + 1 ActiveCell.Value = "0" ActiveCell.Offset(1, 0).Activate Loop Until Count6 = Count5 need to pass Count6 to Procedure1 Sub Procedure1() SetMonth = "August" Count7 = 0 Do Worksheets(SetMonth).Range("M1").Select Bill1 = Application.InputBox("Enter July Amount?") ActiveCell.Value = Bill1 ActiveCell.Offset(1, 0).Activate Count7 = Count7 + 1 Loop Until Count7 = Count6 Worksheets(SetMonth).Range("A:K").Select Worksheets(SetMonth).Columns("A:K").AutoFit End Sub Does this mean then that I change the following or am I misunderstanding, its been a while since I wrote visual basic script: Private Sub Month_Click(ByVal Count6 As String) and Sub Procedure1(Count6 As String)

          L 1 Reply Last reply
          0
          • M Matthew Leggett

            Hi Private Sub Month_Click() Worksheets(SetMonth).Range("M1").Select Count6 = 0 Do Count6 = Count6 + 1 ActiveCell.Value = "0" ActiveCell.Offset(1, 0).Activate Loop Until Count6 = Count5 need to pass Count6 to Procedure1 Sub Procedure1() SetMonth = "August" Count7 = 0 Do Worksheets(SetMonth).Range("M1").Select Bill1 = Application.InputBox("Enter July Amount?") ActiveCell.Value = Bill1 ActiveCell.Offset(1, 0).Activate Count7 = Count7 + 1 Loop Until Count7 = Count6 Worksheets(SetMonth).Range("A:K").Select Worksheets(SetMonth).Columns("A:K").AutoFit End Sub Does this mean then that I change the following or am I misunderstanding, its been a while since I wrote visual basic script: Private Sub Month_Click(ByVal Count6 As String) and Sub Procedure1(Count6 As String)

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            No, I wrote that as VB.Net. For VBScript make it Sub Procedure1(variablename). Look for the Passing Variables into a Subroutine section on VBScript in a Nutshell[^].

            A 1 Reply Last reply
            0
            • L Lost User

              No, I wrote that as VB.Net. For VBScript make it Sub Procedure1(variablename). Look for the Passing Variables into a Subroutine section on VBScript in a Nutshell[^].

              A Offline
              A Offline
              AJAYWVK87
              wrote on last edited by
              #6

              i am not understand your ans. so pls. describe it

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups