Try this then
Code:.Cells(Rx1, 3).Resize(,6).Value = var
Try this then
Code:.Cells(Rx1, 3).Resize(,6).Value = var
A dream is not something you see when you are asleep, but something you strive for when you are awake.
It's usually a bad idea to say that something can't be done.
The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve
Join us at Facebook
Great works FAST :D
Last question... what do i need to change when working with multitabs and multiple listboxes. I tried to use the code below.
Code:Private Sub CommandButton2_Click() Dim var(3 To 8) As String Dim j As Long Dim x As Long If Me.ListBox2.ListIndex = -1 Then MsgBox "No Data Selected" Exit Sub End If If Me.TextBox2.Value = "" Then Exit Sub Rx2 = Rx2 + Me.ListBox1.ListIndex 'row index With Sheets("INPUT BS LISTBOX") For j = 3 To 8 var(j) = Me.Controls("TextBox" & j + 8).Text 'Starts in Textbox 9 Next j .Cells(Rx2, 3).Resize(, 6).Value = var End With Call UserForm_Initialize End Sub
Got a question about the code i used couple of days. When i typed for example 3 in my textbox and i pushed on update it showed automatically 3% but with the new code it does not take over the cell property'show can.
OLD CODE (fills cell format e.g. 3 will be automatically 3%)
NEW CODE FAST (but puts only the value in the box e.g. 3 stays 3.)Code:Private Sub CommandButton2_Click() Dim j As Long Dim x As Long If Me.ListBox1.ListIndex = -1 Then MsgBox "No Data Selected" Exit Sub End If If Me.TextBox1.Value = "" Then Exit Sub Rx1 = Rx1 + Me.ListBox1.ListIndex With Sheets("INPUT WV LISTBOX") For j = 8 To 10 .Cells(Rx1, j).Value = Me.Controls("TextBox" & j - 3).Text Next j End With Call UserForm_Initialize End Sub
Code:rivate Sub CommandButton2_Click() Dim var(3 To 8) As String Dim j As Long Dim x As Long If Me.ListBox1.ListIndex = -1 Then MsgBox "No Data Selected" Exit Sub End If If Me.TextBox1.Value = "" Then Exit Sub Rx1 = Rx1 + Me.ListBox1.ListIndex With Sheets("INPUT WV LISTBOX") For j = 3 To 8 var(j) = Me.Controls("TextBox" & j).Text Next j .Cells(Rx1, 3).Resize(, 6).Value = var End With Call UserForm_Initialize End Sub
Last edited by Tony; 02-09-2013 at 01:04 AM.
Bookmarks