What exactly is happening? I didn't have your file to test it. I'm sure you can figure out what's going wrong where, since it's pretty straight forward...
What exactly is happening? I didn't have your file to test it. I'm sure you can figure out what's going wrong where, since it's pretty straight forward...
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
It updates the the 6 cells in 1 column 6 rows instead of updating the 6 cells in 1 row and 6 columns. See Example.xlsm
Last edited by Tony; 02-06-2013 at 11:27 PM.
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's how 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.
tryCode:.Cells(Rx1, 3).Resize(, 6).Formula = 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
Just tested but not working
Why don't you post a sample workbook ???
See Example.xlsm
When i useit works but then the data wil be placed in 1 columnCode:.Cells(Rx1, 3).Resize(6).Value = Application.Transpose(var)
When i useit places the content in 6 column on 1 row what i need but then the cell propertys will not be usedCode:.Cells(Rx1, 3).Resize(, 6).Value = var
Solved the problem usingone small change...but don't know why that function application.transpose does the trick.Code:.Cells(Rx1, 3).Resize(, 6).Value = Application.Transpose(var)
Bookmarks