convert string to int?
-
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 -
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 veonDim 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
-
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
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 -
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 SubWhat 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
-
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 veontry 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
-
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
hi tbxRow is the id of the textbox, i name it as tbxRow thanks veon
-
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
hi thanks for replying, but its the same error thanks veon
-
hi thanks for replying, but its the same error thanks veon
Are you sure your variable has any value?
-
Are you sure your variable has any value?
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
-
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
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
-
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
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
-
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
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
-
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
hi ok thanks a lot realy thanks for the help and this is what i want thanks thanks veon :-D