Dear all,
I`m having trouble in creating a correct VBA code for a copy paste function.
Main sheet "home"
Second sheet "clients"
On "home" sheet i have 4 cells ( C column - "C4:C7") representing data: id nr, name from a dropdown, name entered manually , and a date.
This data should be copied in the second "clients" sheet in a table "clientstable" header starting on row 5, first table row should be 6.
i made progress but the paste entry goes to row 7 and not in the table,
second progress , data goes in the table but fills the entire table and not specific row by row as i need it.
the goal is that data should go from one cell C4 , c5 , c6 ,c7 home sheet to A6 B6 C6 D6 clients sheet in table clientstable to next row in line available
I`m having trouble in creating a correct VBA code for a copy paste function.
Main sheet "home"
Second sheet "clients"
On "home" sheet i have 4 cells ( C column - "C4:C7") representing data: id nr, name from a dropdown, name entered manually , and a date.
This data should be copied in the second "clients" sheet in a table "clientstable" header starting on row 5, first table row should be 6.
i made progress but the paste entry goes to row 7 and not in the table,
second progress , data goes in the table but fills the entire table and not specific row by row as i need it.
the goal is that data should go from one cell C4 , c5 , c6 ,c7 home sheet to A6 B6 C6 D6 clients sheet in table clientstable to next row in line available
Rich (BB code):
Sub InsertNewclient()
'
' Newclient Macro
'
'
Dim countrow As Long
Dim countcol As Long
Dim i As Integer
Dim CurrentSheet As Object
countrow = Sheets("Clients").UsedRange.Rows.Count
countcol = Sheets("Clients").UsedRange.Columns.Count
Sheets("Home").Select
Range("C4:C7").Select
Selection.Copy
Sheets("Clients").Select
Range("Clientstable").Select
Cells(Rows.Count, 1).End(xlUp)(1).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub