עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

עזרה בVB

Featured Replies

פורסם

אני לא מבין כלום בVB, אבל הייתי צריך לכתוב קוד לאקסל, אז למדתי משהו אבל משום מההוא כותב לי overlow ומפסיק

הנה הקוד

מה הטעות?


Private Sub replace()

Dim vl As String
Dim char As String
Dim str As String
Dim repeat As String

For i = 1 To 3000
str = ""
repeat = "2342"
vl = Cells(i, "K").Text
For j = 1 To Len(vl)
char = ""
Select Case Mid(vl, j, 1)
Case repeat
char = "Z"
Case 1
char = "B"
Case 2
char = "E"
Case 3
char = "L"
Case 4
char = "F"
Case 5
char = "A"
Case 6
char = "C"
Case 7
char = "T"
Case 8
char = "O"
Case 9
char = "R"
Case 0
char = "S"
Case "-"
char = "-"
End Select
str = str + char

repeat = Mid(vl, j, 1)
If char = "Z" Then
repeat = "3423"
End If
Next j

Dim s As Integer
s = Val(vl)
If s < 0 Then
str = Right(str, Len(str) - 1)
str = str + ")"
str = "(" + str
End If
If Cells(i, "K").Value <> "Sell p/c" And Cells(i, "K").Value <> "Mounting" Then
Cells(i, "K").Value = str
End If

Next i
End Sub






פורסם

תנסה לדבג את הקוד - תוריד חלקים מהפונקציה עד שתמצא את החלק הבעייתי (תתחיל מלעשות לולאה בגודל 3 במקום 3000...)

פורסם
  • מחבר

אני שם לב שזה קורה בכל מספר בן חמש ספרות שיש בו 3 אפסים או יותר, אם מישהו יכול לעזור לי להבין למה, תודה מראש

פורסם

נראה שמדובר במגבלה על גודלו של Integer שהיא 32767.

הגדר את s כLong

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.