Learner123
02-09-2011, 02:33 PM
Hi everyone,
I am having a serious problem with one of my codes. Its holding up my entire project and my boss is growing impatient. :help
Any help will be appreciated!!!
I am trying to develop a code that looks up a specific value ('ComboBox2'). It should then move over one column and down one row (offset (1,1)). At this point I need the code to search downward for the first empty cell and insert a row above it.
The code that I have is:
Private Sub Update_Click()
Dim RowCount As Long
Dim c As Range
Set c = Columns(1).Find(ComboBox2.Value, lookat:=xlWhole)
If c.Offset(1, 2) = "" Then
Set c = c.Offset(1, 1)
Else
'''''' insert row after
Set c = c.End(xlDown)(2)
c.Offset(1).EntireRow.Insert
End If
c.Offset(, 1) = Me.TextBox1a
c.Offset(, 4) = Me.TextBox2a
c.Offset(, 7) = Me.TextBox3a
c(2).EntireRow.Insert
End Sub
I welcome any level of guidance. : pray2:
Thanks in advance for your time!!!:bow:
I am having a serious problem with one of my codes. Its holding up my entire project and my boss is growing impatient. :help
Any help will be appreciated!!!
I am trying to develop a code that looks up a specific value ('ComboBox2'). It should then move over one column and down one row (offset (1,1)). At this point I need the code to search downward for the first empty cell and insert a row above it.
The code that I have is:
Private Sub Update_Click()
Dim RowCount As Long
Dim c As Range
Set c = Columns(1).Find(ComboBox2.Value, lookat:=xlWhole)
If c.Offset(1, 2) = "" Then
Set c = c.Offset(1, 1)
Else
'''''' insert row after
Set c = c.End(xlDown)(2)
c.Offset(1).EntireRow.Insert
End If
c.Offset(, 1) = Me.TextBox1a
c.Offset(, 4) = Me.TextBox2a
c.Offset(, 7) = Me.TextBox3a
c(2).EntireRow.Insert
End Sub
I welcome any level of guidance. : pray2:
Thanks in advance for your time!!!:bow: