Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
This is the code so far:
Global GrNom4 As Single
GrNom4 = InputBox("nnnnnnn&mmmmmmmm XX:")
Dim RowPtr As Long, Chan As Long, F1 As Variant, WData As String, i As Integer
RowPtr = ThisWorkbook.Sheets("Sheet1").Cells(3000, 1).End(xlUp).Row + 1
Chan = DDEInitiate("software", "Com14")
F1 = DDERequest(Chan, "Field(1)")
WData = F1(1)
ThisWorkbook.Sheets("Sheet1").Cells(RowPtr, 1).Formula = WData
If WData < 0.5 * GrNom4 or WData > 1.5 * GrNom4 Then
ThisWorkbook.Sheets("Sheet1").Cells(RowPtr, 1).Value = ""
i = RowPtr Mod 31
If i = 0 Then
ThisWorkbook.Sheets("Sheet1").Cells(RowPtr, 1).Formula = "....................."
ThisWorkbook.Sheets("Sheet1").Cells(RowPtr, 2).Value = Time
What the code does: i start the macro, insert one value say 10 and the macro introduces it in column A cel by cell unless the received value is below 50% or above 150% of 10. The values are received from balances.
What i want:
1.[b]If WData < 0.5 * GrNom4 or WData > 1.5 * GrNom4 Then[/b] - this is ok but i needed it to skip a value...say 50. So everything below 50% or above 150% from the original value should not be entered in a cell, except for the "50" value.
2. A column can have a maximum of 3000 values (it can also have 200).... i want to select 30 random values and calculate their average, and then calculate a formula. Something like AAA * 0.603 - this average = XX.
This is not my code. I am not this good.
Any help would be greatly appreciated.
0 · ·