Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Data entry to other workbook excel vba

neil1188

Recruit
Basic Member
Messages
7
Reaction score
0
Points
16
guys question lang po..

ngdadata transfer na ako from my userform ang problem ngooverwrite lang xia if mgkaroon ng another input.

bali dapat next row na xia.. pero laging nsa row one lang xia


excel vb po gamit ko po.. any idea po?








Dim mr As Workbook


Dim path As String
path = "C:\Users\Carlo\Desktop\PAY-INS-TEMP-OCT-17.xlsx"
Application.ScreenUpdating = False
Workbooks.Open path

Set myrange = ActiveWorkbook.Sheets("PYI").Cells(6, 1).End(xlUp).Offset(1, 0)





myrange.Offset(0, 2).Value = packagetype.Value
myrange.Offset(0, 3).Value = reference1.Value
myrange.Offset(0, 4).Value = amount1.Value
myrange.Offset(0, 6).Value = upline1.Text
myrange.Offset(0, 7).Value = ComboBox3.Value
myrange.Offset(0, 1).Value = name1.Value
 
Code:
Sub neil1188()

Dim lrow As Long
Dim ws As Worksheet

Set ws = ThisWorkbook.Worksheets("PYI")

'Get last row
lrow = ws.Range("B" & Rows.Count).End(xlUp).Row + 1

'Populate value
ws.Range("C" & lrow).Value = packagetype.Value
ws.Range("D" & lrow).Value = reference1.Value
ws.Range("E" & lrow).Value = amount1.Value
ws.Range("G" & lrow).Value = upline1.Text
ws.Range("H" & lrow).Value = ComboBox3.Value
ws.Range("B" & lrow).Value = name1.Value

Set ws = Nothing

End Sub
 
Code:
Sub neil1188()

Dim lrow As Long
Dim ws As Worksheet

Set ws = ThisWorkbook.Worksheets("PYI")

'Get last row
lrow = ws.Range("B" & Rows.Count).End(xlUp).Row + 1

'Populate value
ws.Range("C" & lrow).Value = packagetype.Value
ws.Range("D" & lrow).Value = reference1.Value
ws.Range("E" & lrow).Value = amount1.Value
ws.Range("G" & lrow).Value = upline1.Text
ws.Range("H" & lrow).Value = ComboBox3.Value
ws.Range("B" & lrow).Value = name1.Value

Set ws = Nothing

End Sub


thanks sir ill try this and keep you updated ok na sir pero paano po kpag sa sheet2 ilalagay?

thanks po sir..

- - - Updated - - -

thanks sir ill try this and keep you updated ok na sir pero paano po kpag sa sheet2 ilalagay?

thanks po sir..




ok na boss nadale na.. salamat po
 
Last edited:
Back
Top Bottom