[Solved] define an input suggestion with vba in excel

You could you a simple userform to select and parse data selection into the row you clicked. First use an Event when you click in the column you want the reminder to pop up in. In this case I choose “D”. Private Sub Worksheet_Change(ByVal Target As Range) Dim arr If Not Intersect(Target, Range(“D:D”)) Is Nothing … Read more

[Solved] need excel function for this issue

Here is a working code of a VBA function that fits your needs: Sub RedistributeData() Dim X As Long, LastRow As Long, A As Range, Table As Range, Data() As String Const Delimiter As String = vbLf Const DelimitedColumn As String = “B” Const TableColumns As String = “A:B” Const StartRow As Long = 1 … Read more

[Solved] Identify and output first and last records by group [closed]

If able to sort by date within task and to ensure that any subsequent sheet starts at a new task and the last ColumnB and ColumnC values on each sheet are repeated in the row immediately below, a formula might suit: =IF(A1<>A2,A1&”|”&VLOOKUP(A1,A:B,2,0)&”|”&C1&”|”&B2-VLOOKUP(A1,A:B,2,0),””) with the columns where the formula output is evident filtered to exclude blanks, … Read more

[Solved] Macro concatenating strings + number + date

try this Option Explicit Sub main() Dim data As Variant With Range(“A1”).CurrentRegion data = .Resize(.Rows.Count – 1, 4).Offset(1).Value End With ReDim wynik(1 To UBound(data)) As Variant Dim i As Variant For i = 1 To UBound(data) data(i, 3) = Format(data(i, 3), “yyyy-mm-dd”) wynik(i) = Join(Application.index(data, i, 0), “_”) Next Range(“E2”).Resize(UBound(data)).Value = Application.Transpose(wynik) End Sub 3 … Read more

[Solved] seeking a solution for when user decrements a cell’s value, another cell (different column) will increment that same value

Here is an example for columns A and B. Insert this event macro in the worksheet code area: Private Sub Worksheet_Change(ByVal Target As Range) Dim A As Range, OldValue As Variant, NewValue As Variant, Delta As Variant Set A = Range(“A:A”) If Intersect(Target, A) Is Nothing Then Exit Sub If Target.Count > 1 Then Exit … Read more

[Solved] Need VBA Code to removing Dot (.) from the amount and it should display number with length of 6 digits [closed]

add this into a seperate module Function sixdigits(amount) As String Dim strAmount As String strAmount = Replace(Left(amount, 6), “.”, “”) ‘ use replace and left to create a string of 6 characters Do Until Len(strAmount) >= 6 ‘ loop until 6+ strAmount = “0” & strAmount Loop: sixdigits = strAmount End Function then in your … Read more

[Solved] Deleting duplicates, keeping lowest value in different column [closed]

You can add a column where you could check if PPFROM (the value) is the min of the group (ARTICLE). Please adjust the references inside the formula. This is the formula: =IF(MINIFS($E$4:$E$10;$M$4:$M$10;M4)=E4;”Keep”;”Delete”) After that you can filter by the new column and delete the rows marked with “Delete”. solved Deleting duplicates, keeping lowest value in … Read more

[Solved] Copying a variable contained in cell into another cell

Try the code below, explanations inside the code’s comments: Option Explicit Sub ExtractAfterShowOnly() Dim WordsArr() As String Dim i As Long Dim MatchString As String ‘ use Split to read each section between “https://stackoverflow.com/” as arra element WordsArr = Split(Range(“A2”).Value2, “https://stackoverflow.com/”) ‘ loop through array For i = 1 To UBound(WordsArr) ‘ if there’s a … Read more

[Solved] how to calculate time difference in excel working hours only

You will need a helper column with this formula: =24*(SUMPRODUCT((TEXT(ROW(INDEX(AAA:AAA,$F$1):INDEX(AAA:AAA,$F$2)),”dddd”)=A1)*(C1-B1))-IF(TEXT($F$1,”dddd”)=A1,MOD($F$1,1)-B1,0)-IF(TEXT($F$2,”dddd”)=A1,C1-MOD($F$2,1),0)) Then sum that column. Here it is in one formula using NETWORKDAYS.INTL =IF(DATEDIF(F1,F2,”d”)>1,NETWORKDAYS.INTL(F1+1,F2-1,”0000011″)*12+NETWORKDAYS.INTL(F1+1,F2-1,”1111101″)*4,0)+IF(DATEDIF(F1,F2,”d”)>0,(MOD(F2,1)-IF(WEEKDAY(F2,2)<6,TIME(7,0,0),TIME(9,0,0)))*24+(IF(WEEKDAY(F1,2)<6,TIME(19,0,0),TIME(13,0,0))-MOD(F1,1))*24,(F2-F1)*24) 4 solved how to calculate time difference in excel working hours only