thanks, yea its when it runs and a certain detail isnt input, but i am still working on that, but program seems to be working so hope alls well, thank you very much for the help
Posts by Daniel1996
-
-
thank you for your response, i am aware it needs a tidy up, i am still new to programming so its a bit tricky for me to have gotten as far i have, i will run the program and see what happens because it usually only gives me an error about 20-30 minutes in however im not sure what you mean by missing sheets as everything is running according to the functionality it is required
if you can please advise on missing sheets you are referring to so that i can learn, the more i can learn the better i can be
-
sorry when i clicked insert it put it in the middle of the page, it is Copy of TextBox_Class.xlsm that the program is written
-
good day, i have written a program as seen in the file linked, however i am using a Lenovo touch pad and have the windows 10 excel working on it, what happens is when i run my program i receive a error message saying catastrophic error, when i take off the function of hiding the boarder as seen under modules " Hide Boarder" then i do not occur an error, is there any other method i could use to hide the boarder as it is one of the more relevant functions of importance in this program
-
this could work as an alternative, thank you so much for all your help.
-
i have multiple textboxes on a multipage user form, the userform will be used on a windows tablet without a keyboard, so i wish to use the numberpad as an alternative method,
there is a simple way but it will require way too much coding,
what i want to do is program my number pad i created to insert the numbers i place into the label( called lbl) on the number pad into the textbox( eg. textbox i selected
so effectively i want to select a textbox ( eg. textbox3) and then use the number pad and once i click enter i want the value i typed in lbl to then go into the textbox ( eg. textbox3)
-
there may be more then one of the same number used so in the code you wrote i can only use a single 1 value i can post the actual folder i wish to use it in if that may help
-
kind of, what i need is for the value of lbl by the number pad to go to the textbox i click to input that value
because i need it for a test sheet i made so its only numeric figures
-
good day, i have set up a program for a windows table and i could not get the screen keyboard to work for what i need so i have created a number pad to do the trick however i am unable to figure out how to get the value in a label to insert into the textbox i need
so what i want to happen is to click on a textbox, and then type an amount onto the number pad and upon enter it should input the value to the selected textbox
i have put an example under testform in the attachment
if you have any ideas any would be appreciated
-
sorry i only saw your second message after i sent attachments, this works perfectly thank you so much
-
Good day, i have created a multi purpose userform that i would like to lock to the entirety of a tablet so the the user of the tablet cannot leave the program without entering a code upon a close button.
i used a code on a separate userform that worked perfectly to hide the boarders, that code is :
Code
Display MoreOption Explicit '1. Hide Boarder on Form '__________To Hide Boarder Around Form__________' #If VBA7 Then Public Declare PtrSafe Function FindWindow Lib "user32" _ Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Public Declare PtrSafe Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Public Declare PtrSafe Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Public Declare PtrSafe Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long #Else Public Declare Function FindWindow Lib "user32" _ Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Public Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Public Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Public Declare Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long #End If Sub HideBar(frm As Object) Dim Style As Long, Menu As Long, hWndForm As Long hWndForm = FindWindow("ThunderDFrame", frm.Caption) Style = GetWindowLong(hWndForm, &HFFF0) Style = Style And Not &HC00000 SetWindowLong hWndForm, &HFFF0, Style DrawMenuBar hWndForm End Sub
However when i try use this same code when working on a different userform it does hide the boarders,,
if there are any other methods i could try any help would be appreciated
-
the final objective is to use the calculations to find a value for W which i have shown in my first post with the code, i have messed around a bit and have worked it out thank you for your help
-
the way my naming works is the the box is labled
Txtbox1A2 meaning the first number is my row and second is the column number, column is seen as J
i = 1
J = 2 -
it runs the same as i had it except it is giving me a type mismatch error once the CDbl() function is used thats wht the Val() function worked the best here,
all i am getting stuck on is trying to find the Numeric Value of the things so when i F8 through it should read as follows when i hover mice over the codes
WC = 22.55
W1 = 100.04
W2 = 122.63instead of
WC = Txtbox1A2
W1 = Txtbox1A3
W2 = Txtbox1A4and so on
-
i have the formula to just get the first lines answer but want to be able to loop through lines so that my code wont be as long.
if you have any advice it would be much apreciated
sorry you may have to zoom the userform to 100 i am not sure if i set it back
-
if you go to userform 3 page 3 there will be values in Txtbox for WC, W1 and W2
i am trying to get an answer for the moisture Content,the formula i am testing and playing with is at the bottom of the code in userform 3, once i have it able to get all final values i can use same formula for my other calculations
[ATTACH]n1225851[/ATTACH]
-
good day
i have written a macro to find the answer to a sum i have for a single line in userforms Excel vba
but now trying to do the same through a loop i am not getting the textbox valuesbelow is the code i am using currently that picks up text box names but not the values in the textbox
Private Sub CalculateGroup()
Dim WC As String
Dim W1 As String
Dim W2 As String
Dim D As String
Dim R As String
Dim T As Double
Dim W As String
Dim Q As String
Dim i As Integer
Dim J As Integer
Dim test As IntegerFor i = 1 To 4
'test = UserForm3.Controls("Txtbox" & i & "A" & J).Value <----- this is the textbox where the answer goesWC = "Txtbox" & i & "A" & 2
W1 = "Txtbox" & i & "A" & 3
W2 = "Txtbox" & i & "A" & 4R = (Val(W1) + Val(WC)) - Val(W2)
T = Val(R)Q = Val(R) / Val(W1)
W = Val(Q) * 100
'test.Value = W
' test.Text = Format(test, "0.00")Next i
End Sub
i have tried Val("Txtbox" & i & "A" & 2) but it gives a 0 instead of textbox value
if anyone could help it would be much appreciated
-
the file you sent when i ran it it gave me dubug error but what i did in my find data modue was i took this line of code :
CodeIf Not rgFound Is Nothing Then firstAddress = rgFound.address RowFound = rgFound.row Sheets("Sheet1").Range("A" & TargetRow) = Sheets("sheet2").Range("b" & RowFound) Sheets("Sheet1").Range("c" & TargetRow) = Sheets("sheet2").Range("d" & RowFound) and added: Sheets("Sheet1").Range("O" & 2) = Sheets("sheet2").Range("F" & RowFound)
under it and that fixed the problem i was having
-
ok i have found the correct solution, it was so simple i feel kinda silly but thank you so much for the help
-
all passwords are set as 123 until i am done
i have got the whole userform and sheet to work together and like i said unfortunately i am brand new to this kind of work so i am learning on the go
i appreciate everything you have said and helped with
i shall change the merged cells in future as i have witnessed in my coding it makes life hard haha
the inputting of the weight is the last step needed for me to complete this project