Good evening all,
I am new to Excel this will be my first question. I have enjoyed reading and searching through the Forums and comments on Chandoo. I have found it very useful.
I have a spreadsheet that is populated via a Userform. I have arrived at a problem where I don't know how to write the Code so as to Skip Column B i.e.
Column A, Column B, Column C, Column D, Column E, Column F,
Serial, ID, List of Activities, Owner Environment, Planned Start, Planned end,
1, HQ DLC0001, Campaign Plan, HQ DLC, 28-Feb-14, 18-Jul-14,
From the text Box I fill Serial, List of Activity, Owner Environment, Planned Start, Planned End.
Column B - ID - Is a unique ID that is created via a formula.
How can I add a line to the code below so that the User form skips Column B and only places the inputted data into Columns A, C, D, E and F.
Thank you.
David
I am new to Excel this will be my first question. I have enjoyed reading and searching through the Forums and comments on Chandoo. I have found it very useful.
I have a spreadsheet that is populated via a Userform. I have arrived at a problem where I don't know how to write the Code so as to Skip Column B i.e.
Column A, Column B, Column C, Column D, Column E, Column F,
Serial, ID, List of Activities, Owner Environment, Planned Start, Planned end,
1, HQ DLC0001, Campaign Plan, HQ DLC, 28-Feb-14, 18-Jul-14,
From the text Box I fill Serial, List of Activity, Owner Environment, Planned Start, Planned End.
Column B - ID - Is a unique ID that is created via a formula.
How can I add a line to the code below so that the User form skips Column B and only places the inputted data into Columns A, C, D, E and F.
Code:
Option Explicit
Dim id As Integer, i As Integer, j As Integer, flag As Boolean
Sub GetData()
Sheets("DLC MAS Template").Select
If IsNumeric(UserForm1.TextBox1.Value) Then
flag = False
i = 10
id = UserForm1.TextBox1.Value
Do While Cells(i + 1, 1).Value <> ""
If Cells(i + 1, 1).Value = id Then
flag = True
For j = 2 To 5
If j = 3 Then
UserForm1.Controls("combobox1").Value = Cells(i + 1, j).Value
Else
UserForm1.Controls("TextBox" & j).Value = Cells(i + 1, j).Value
End If
Next j
End If
i = i + 1
Loop
If flag = False Then
For j = 2 To 5
If j = 3 Then
UserForm1.Controls("combobox1").Value = ""
Else
UserForm1.Controls("TextBox" & j).Value = ""
End If
Next j
End If
Else
ClearForm
End If
End Sub
Thank you.
David
Last edited: