Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
hello i search a lot of information in internet but i can not get it work .I tray to add the search results from listbox in a sheet number the sheet name is (Tabelle1 ) listbox name is (lsbWarenausgang) and the CommandButton name is (CommandButton3)
Assuming you want pass the value to the cell C1:
Private Sub CommandButton3_Click()
Worksheets("Tabelle1").Range("C1").Value = lsbWarenausgang.Value
End Sub
For multi-columns ListBox:
Private Sub CommandButton3_Click()
Dim i As Integer
Dim k As Integer
With Me.lsbWarenausgang
For k = 0 To .ListCount - 1
If .Selected(k) = True Then
For i = 1 To 5
Worksheets("Tabelle1").Cells(i, 1) = Me.lsbWarenausgang.List(k, i - 1)
Next i
End If
Next k
End With
End Sub
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I have a Textbox multiline=true
I use formula Split that Textbox but string in textbox can not vlookup value because that is string symbol special.
This is your code,
please check help me.
Sub CommandButton22_Click()
With Sheet2
If Trim(TextBox21.Text) <> "" Then
If UBound(Split(TextBox21.Text, Chr(10))) > 0 Then
For i = 0 To UBound(Split(CStr(TextBox21.Text), Chr(10)))
Dim a As String
a = Trim(CStr(Split(TextBox21.Text, Chr(10))(i)))
If IsEmpty(a) = False Then
.Cells(1 + i, "A").Value = Trim(CStr(a))
End If
Next i
End If
End If
End With
End Sub
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am trying cut 4 adjacent cells and insert a new row below and paste it on a new row.
My input is similar to
I have 4 columns Addr,Phone,Count,Amount. Some Rows of my excel sheet contains multiple n numbers of entries. I want to cut multiple of 4 cells and insert a new row below and paste it on.
The output would be similar to
I tried with transform function but unable to produce the expected result.
How can I do this with vba code or any excel functions
Here is the code its exactly work with your requirement
Sub Narasappa()
For i = 2 To 1000
If ThisWorkbook.Worksheets(5).Cells(i, 2) = "" Then
Exit For
End If
For j = 6 To 1000 Step 4
If ThisWorkbook.Worksheets(5).Cells(i, j).Value = "" Then
Exit For
Else
ThisWorkbook.Worksheets(5).Cells(i, j).Resize(, 4).Cut
ThisWorkbook.Worksheets(5).Range("B" & i + 1).Insert xlShiftDown
End If
Next
Next
End Sub
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am new to VBA and would like to learn by creating expense database, How do I transferring and making monthly database?
If dashboard date is matching to Aug17 column A, move data from dashboard to Aug17 respective row. If possible, I would like it to search dashboard date to all worksheet and move data to respective row if matching found. Thanks in advance.
DashBoard
Aug17
Based on your response to my questions in the comments here's code that does what you asked. Notice that the final msgbox will never be encountered if the date is found. Hopefully you will be able to adjust this code to suit your needs once you understand it.
Sub test()
Dim r As Range, dashSh As Worksheet, dashR As Range, sh As Worksheet
Dim mo As String, yr As String
Set dashSh = Worksheets("Dashboard")
Set dashR = dashSh.Range("A5:J5")
mo = Application.WorksheetFunction.Text(dashR.Columns(1), "mmm")
yr = Application.WorksheetFunction.Text(dashR.Columns(1), "yy")
Set sh = Worksheets(mo & yr)
sh.Activate
Set r = sh.Range("A5")
While r <> ""
If r = dashR.Columns(1) Then
r.Select
dashR.Copy
sh.Paste
End
End If
Set r = r.Offset(1, 0)
Wend
MsgBox ("date not found")
End Sub
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have a table below with details in column A and B. I want to search a string in C from A and paste value of Column B in Column D with help of VBA.
Example:-
A B C D
STRAT Strategy s_strat_nhnh Strategy
TRDMK Trademarks bng_trdm_ndnd Trademarks
TRDMK not in bng_trdm_ndnd.
But if I got it right, you want something like
Then Code is:
Sub Test()
CStartRow = 1
CEndRow = 5
AStartRow = 1
AEndRow = 3
For I = CStartRow To CEndRow
For J = AStartRow To AEndRow
If InStr(UCase(Range("C" + CStr(I))), UCase(Range("A" + CStr(J)))) Then
Range("D" + CStr(I)) = Range("B" + CStr(J))
Exit For
End If
Next J
Next I
End Sub
If you do not want to use VBA then you can use this formula.
Formula in d1 cell is:
=IF(ISNUMBER(SEARCH(A1,C1)),B1,"")
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
can somebody help me or any suggstion code how can I start in conditional for getting the range of specific range number..
-Example there is textbox 1, 2, 3 and 4...
-I inputed 1 in textbox1 and 5 in textbox2
-in Textbox 3 I will input 3
-In textbox 4 will give the result and it will give me TRUE because 3 is in range of 1-5 but if I input 6 or 0 or any number that is not in the range, it will give me FALSE because it is not in the range of 1-5.
As I understand it, you want to input the range in TextBox1 and TextBox2, the number that needs to be evaluated in TextBox3 and display the result in TextBox4.
Here is the code for that:
If CDbl(TextBox3.Text) > CDbl(TextBox1.Text) And _
CDbl(TextBox3.Text) > CDbl(TextBox2.Text) Then
TextBox4.Text = "TRUE"
Else
TextBox4.Text = "FALSE"
End If