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
  1. Home
  2. General Programming
  3. Visual Basic
  4. convert string to int?

convert string to int?

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
13 Posts 5 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.
  • A Andy_L_J

    Dim n As Integer
    n = CInt(textbox.Text)

    I don't speak Idiot - please talk slowly and clearly I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury Driven to the arms of Heineken by the wife

    V Offline
    V Offline
    veon cheng
    wrote on last edited by
    #3

    hi i have try this code but it jus keep saying object required? this is what i code

    Sub Delete_Row_Excel_VBA()
    Dim n As Integer
    n = CInt(tbxRow.Text)
    Rows(n).Select
    Selection.Delete Shift:=xlUp
    End Sub

    A 1 Reply Last reply
    0
    • V veon cheng

      hi i have try this code but it jus keep saying object required? this is what i code

      Sub Delete_Row_Excel_VBA()
      Dim n As Integer
      n = CInt(tbxRow.Text)
      Rows(n).Select
      Selection.Delete Shift:=xlUp
      End Sub

      A Offline
      A Offline
      Andy_L_J
      wrote on last edited by
      #4

      What is > veon cheng wrote: > > tbxRow.Text

      I don't speak Idiot - please talk slowly and clearly I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury Driven to the arms of Heineken by the wife

      V 1 Reply Last reply
      0
      • V veon cheng

        hi to all this may sound stupid cause i'm new to VBA. in C# we are able to write in this way if i'm not wrong int n = Convert.Toint16(textbox.Text) but how to write in VBA ??? thanks veon

        K Offline
        K Offline
        koolprasad2003
        wrote on last edited by
        #5

        try to use Val in the place of CInt hope it helps.... :)

        If the message is useful for U then please Rate This message... Be a good listener...Because Opprtunity knoughts softly...N-Joy

        V 1 Reply Last reply
        0
        • A Andy_L_J

          What is > veon cheng wrote: > > tbxRow.Text

          I don't speak Idiot - please talk slowly and clearly I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury Driven to the arms of Heineken by the wife

          V Offline
          V Offline
          veon cheng
          wrote on last edited by
          #6

          hi tbxRow is the id of the textbox, i name it as tbxRow thanks veon

          1 Reply Last reply
          0
          • K koolprasad2003

            try to use Val in the place of CInt hope it helps.... :)

            If the message is useful for U then please Rate This message... Be a good listener...Because Opprtunity knoughts softly...N-Joy

            V Offline
            V Offline
            veon cheng
            wrote on last edited by
            #7

            hi thanks for replying, but its the same error thanks veon

            S 1 Reply Last reply
            0
            • V veon cheng

              hi thanks for replying, but its the same error thanks veon

              S Offline
              S Offline
              Sebastian Br
              wrote on last edited by
              #8

              Are you sure your variable has any value?

              V 1 Reply Last reply
              0
              • S Sebastian Br

                Are you sure your variable has any value?

                V Offline
                V Offline
                veon cheng
                wrote on last edited by
                #9

                hi thanks =)) its solved. as i run the code in macro it does not work but when i change it to a button it works =)) thanks for all the helps guys. :-D anw can i have some comments, my boss wants me to programe a excel programe to help them generate report. do you think i should do in spreadsheet or forms. which one would be presentable and more interactive?? thanks veon

                D 1 Reply Last reply
                0
                • V veon cheng

                  hi thanks =)) its solved. as i run the code in macro it does not work but when i change it to a button it works =)) thanks for all the helps guys. :-D anw can i have some comments, my boss wants me to programe a excel programe to help them generate report. do you think i should do in spreadsheet or forms. which one would be presentable and more interactive?? thanks veon

                  D Offline
                  D Offline
                  Dalek Dave
                  wrote on last edited by
                  #10

                  I have to do Excel VBA a lot. I tend to use the Forms, sometimes just have a macro to call it. (eg, Ctrl Q to call the form). I find them easier and more adaptable. Obviously for simple things like a column transfer or a set of create and save Sheets etc a Macro is easier, especially as you can use the recorder. It really is a matter of choice, but I think the Forms a) look more professional, and b) imply you have done more work(even if you haven't), so it is better for workplace kudos.

                  ------------------------------------ "When Belly Full, Chin Hit Chest" Confucius 502BC

                  V 1 Reply Last reply
                  0
                  • D Dalek Dave

                    I have to do Excel VBA a lot. I tend to use the Forms, sometimes just have a macro to call it. (eg, Ctrl Q to call the form). I find them easier and more adaptable. Obviously for simple things like a column transfer or a set of create and save Sheets etc a Macro is easier, especially as you can use the recorder. It really is a matter of choice, but I think the Forms a) look more professional, and b) imply you have done more work(even if you haven't), so it is better for workplace kudos.

                    ------------------------------------ "When Belly Full, Chin Hit Chest" Confucius 502BC

                    V Offline
                    V Offline
                    veon cheng
                    wrote on last edited by
                    #11

                    hi ok so form will be more ideal, but what will be the possible challeng that i will face. besides that is form able to read data from excel, as in use the spreadsheet as the data. thanks veon

                    D 1 Reply Last reply
                    0
                    • V veon cheng

                      hi ok so form will be more ideal, but what will be the possible challeng that i will face. besides that is form able to read data from excel, as in use the spreadsheet as the data. thanks veon

                      D Offline
                      D Offline
                      Dalek Dave
                      wrote on last edited by
                      #12

                      Are you asking if the form can use data from the spreadsheet, manipulate it and then move it back to the same or different spreadsheet? If so, then yes. Something like ... Dim Something as Int With ActiveWorkbook Sheets("Name of worksheet").Select Range ("A1").Select Something = Selection.Value Range ("B1").Select Selection.Value = Something Of course you can choose different sheets and manipulate the data or other things as required, this was just a simple example.

                      ------------------------------------ "When Belly Full, Chin Hit Chest" Confucius 502BC

                      V 1 Reply Last reply
                      0
                      • D Dalek Dave

                        Are you asking if the form can use data from the spreadsheet, manipulate it and then move it back to the same or different spreadsheet? If so, then yes. Something like ... Dim Something as Int With ActiveWorkbook Sheets("Name of worksheet").Select Range ("A1").Select Something = Selection.Value Range ("B1").Select Selection.Value = Something Of course you can choose different sheets and manipulate the data or other things as required, this was just a simple example.

                        ------------------------------------ "When Belly Full, Chin Hit Chest" Confucius 502BC

                        V Offline
                        V Offline
                        veon cheng
                        wrote on last edited by
                        #13

                        hi ok thanks a lot realy thanks for the help and this is what i want thanks thanks veon :-D

                        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