የሚገመተው የንባብ ጊዜ፡- 3 ደቂቃ
የሚከተለው ንኡስ ሂደት ባዶ ሕዋስ እስኪያገኝ ድረስ በገባሪው ሉህ ዓምድ A ውስጥ ካሉ ሕዋሶች እሴቶችን ያነባል። እሴቶቹ በድርድር ውስጥ ይቀመጣሉ። ይህ ቀላል የኤክሴል ማክሮ ምሳሌ የሚከተሉትን አጠቃቀም ያሳያል፡-
Do Until
;Ubound
የተገነባው (የድርድር ከፍተኛውን መረጃ ጠቋሚ ይመልሳል)።' Sub procedure store values in Column A of the active Worksheet
' into an array
Sub GetCellValues()
Dim iRow As Integer ' stores the current row number
Dim dCellValues() As Double ' array to store the cell values
iRow = 1
ReDim dCellValues(1 To 10)
' Do Until loop to extract the value of each cell in column A
' of the active Worksheet, as long as the cell is not blank
Do Until IsEmpty(Cells(iRow, 1))
' Check that the dCellValues array is big enough
' If not, use ReDim to increase the size of the array by 10
If UBound(dCellValues) < iRow Then
ReDim Preserve dCellValues(1 To iRow + 9)
End If
' Store the current cell in the CellValues array
dCellValues(iRow) = Cells(iRow, 1).Value
iRow = iRow + 1
Loop
End Sub
አሰራሩ የነቃውን የስራ ሉህ በአምድ A ውስጥ በአንድ ድርድር ውስጥ ያከማቻል።
Do Until
ባዶ ህዋሶችን ችላ በማለት የእያንዳንዱን ሕዋስ ዋጋ በአምድ A ከንቁ የስራ ሉህ ያወጣል።If UBound(dCellValues) < iRow
"የdCellValues ድርድር መረጃውን ለመያዝ በቂ መጠን ያለው መሆኑን ያረጋግጣል፣ ካልሆነ፣ የድርድር መጠኑን በ10 ለመጨመር ReDim ይጠቀሙdCellValues(iRow) = Cells(iRow, 1).Value
” አሁን ያለውን ሕዋስ በሴልቫልዩስ ድርድር ውስጥ ያከማቻልየሚከተለው ንዑስ ሂደት “ሉህ2” የተሰየመውን የሥራ ሉህ ከአምድ A እሴቶችን ያነባል እና በእሴቶቹ ላይ የሂሳብ ስራዎችን ያከናውናል። የተገኙት ዋጋዎች አሁን ባለው ንቁ የስራ ሉህ አምድ A ውስጥ ታትመዋል።
ይህ ማክሮ ይህንን ያሳያል፡-
Do Until
;' Sub procedure to loop through the values in Column A of the Worksheet
' "Sheet2", perform arithmetic operations on each value, and write the
' result into Column A of the current Active Worksheet ("Sheet1")
Sub Transfer_ColA()
Dim i As Integer
Dim Col As Range
Dim dVal As Double
' Set the variable 'Col' to be Column A of Sheet 2
Set Col = Sheets("Sheet2").Columns("A")
i = 1
' Loop through each cell of the column 'Col' until
' a blank cell is encountered
Do Until IsEmpty(Col.Cells(i))
' Apply arithmetic operations to the value of the current cell
dVal = Col.Cells(i).Value * 2 + 1
' The command below copies the result into Column A
' of the current Active Worksheet - no need to specify
' the Worksheet name as it is the active Worksheet.
Cells(i, 1) = dVal
i = i + 1
Loop
End Sub
በአንድ የተወሰነ የሉህ ክልል ውስጥ ያለ ሕዋስ ሲዘምን የሚቀጣጠል ቀላል VBA ማክሮን እንፃፍ። በአምድ B (ከB4 እስከ B11) ለውጦችን መከታተል ይፈልጋሉ እና የለውጡን ቀን እና ሰዓት በአምድ A ውስጥ ይመዝግቡ።
በዚህ መንገድ እንቀጥል፡-
Developer
አማራጭ ላይ ጠቅ ያድርጉ"Visual Basic
"የ VBA አርታዒን ለመክፈት. Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B1:B10")) Is Nothing Then
Target.Range("A1:A1").Value = Now
End If
End Sub
የስራ ደብተሩን በማክሮዎች የነቃ (ለምሳሌ እንደ .xlsm ፋይል) ያስቀምጡ።
አሁን፣ በአምድ B ውስጥ ያለውን ሕዋስ ባዘመንን ቁጥር (ከረድፍ 1 እስከ 10) በአምድ A ውስጥ ያለው ህዋስ የአሁኑን ቀን እና ሰዓት በራስ-ሰር ያሳያል።
Ercole Palmeri
Coveware by Veeam የሳይበር ዘረፋ የአደጋ ምላሽ አገልግሎቶችን መስጠቱን ይቀጥላል። Coveware የፎረንሲክስ እና የማገገሚያ ችሎታዎችን ያቀርባል…
የመተንበይ ጥገና የዘይት እና ጋዝ ዘርፉን አብዮት እያደረገ ነው፣ ለዕፅዋት አስተዳደር ፈጠራ እና ንቁ አቀራረብ።…
የዩኬ ሲኤምኤ ስለ ቢግ ቴክ ባህሪ በአርቴፊሻል ኢንተለጀንስ ገበያ ላይ ማስጠንቀቂያ ሰጥቷል። እዚያ…
የሕንፃዎችን ኢነርጂ ውጤታማነት ለማሳደግ በአውሮፓ ህብረት የተቀረፀው የ"ኬዝ አረንጓዴ" ድንጋጌ የህግ አውጭ ሂደቱን በ…