hi, experts
i have userform contains 3 textbox and sheet1 contains table i designed from 3 columns i would every time when fill data in userform automatically insert row the same format which before it (the same color ,bold...etc)
this is my code :
Private Sub CommandButton1_Click() On Error Resume Next Dim My_sh As Worksheet Set My_sh = Worksheets("sheet1") Dim lastrow As Integer Dim i% With My_sh lastrow = .Cells(Rows.Count, 1).End(3).Row + 1 For i = 1 To 3 .Cells(lastrow, i).Value = Me.Controls("TextBox" & i) Me.Controls("TextBox" & i) = "" Next MsgBox "done" End With End Sub
Related:
Transfer data from userform to sheet with the same format of table
i would code transfer data from user form to sheet with the same format of the designed table in sheet1 every time i fill data in userform my code is above
my code does work but, what i need add adjusting to become the same format my table
for instance the data begin from row3 and contain blue color and the line is 14 size and bold here when i transfer data every time i would automatically insert the same format row
for instance the data begin from row3 and contain blue color and the line is 14 size and bold here when i transfer data every time i would automatically insert the same format row
when i transfer data it give me this
and what i would this
you can note the color in the item 2
i need adjusting the code above but i no know how
Thefontsize=cells (x,1).font.size
Cells (x + 1,1).font.size = Thefontsize
If you need to test for bold, it would be a true false.
So, a bold font would be
Isitbold = cells (x,1).font.bold
Cells (x+1,1).font.bold = Isitbold