Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help to write a macro.....
Hi All,
I have 2 excel workbook Register.xls & Update.xls my query is every day i enter the data in Register.xls as follows SlNo Module Submodule Date Type Status 1 Mfg FAS 01/02/07 Enh Out 2 Dis Aviance 10/02/07 Enh out 3 Mfg FAS 10/02/07 Enh In 4 Fin SEGA 11/01/07 Bug In now i want to copy the row to Update.xls where the Status is "OUT" can any one help me to write a macro for this TIA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help to write a macro.....
check out the code samples he
http://www.rondebruin.nl/copy5.htm -- Regards, Tom Ogilvy "kiran" wrote in message ... Hi All, I have 2 excel workbook Register.xls & Update.xls my query is every day i enter the data in Register.xls as follows SlNo Module Submodule Date Type Status 1 Mfg FAS 01/02/07 Enh Out 2 Dis Aviance 10/02/07 Enh out 3 Mfg FAS 10/02/07 Enh In 4 Fin SEGA 11/01/07 Bug In now i want to copy the row to Update.xls where the Status is "OUT" can any one help me to write a macro for this TIA |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help to write a macro.....
On Feb 10, 11:44 pm, kiran wrote:
Hi All, I have 2 excel workbook Register.xls & Update.xls my query is every day i enter the data in Register.xls as follows SlNo Module Submodule Date Type Status 1 Mfg FAS 01/02/07 Enh Out 2 Dis Aviance 10/02/07 Enh out 3 Mfg FAS 10/02/07 Enh In 4 Fin SEGA 11/01/07 Bug In now i want to copy the row to Update.xls where the Status is "OUT" can any one help me to write a macro for this TIA Hello there, I am new at this VBA stuff, but what I created does work. There may be a better way to do it, but until I learn more, use this. Gary Sub RtoUCopy() Dim Var1 As Variant Dim Var2 As Variant Dim Var3 As Variant Dim Var4 As Variant Dim Var5 As Variant Dim Var6 As Variant Dim RowR As Integer Dim RowU As Integer ' Both workbooks need to be open first. Cell A2 must be start of data. RowR = 2 RowU = 2 Application.Workbooks("Register.xls").Worksheets(1 ).Activate Do While Not IsEmpty(Cells(RowR, 1)) Var6 = Cells(RowR, 6) If LCase(Var6) = "out" Then Var1 = Cells(RowR, 1) Var2 = Cells(RowR, 2) Var3 = Cells(RowR, 3) Var4 = Cells(RowR, 4) Var5 = Cells(RowR, 5) Application.Workbooks("Update.xls").Worksheets(1). Activate Cells(RowU, 1) = Var1 Cells(RowU, 2) = Var2 Cells(RowU, 3) = Var3 Cells(RowU, 4) = Var4 Cells(RowU, 5) = Var5 Cells(RowU, 6) = Var6 RowU = RowU + 1 Application.Workbooks("Register.xls").Worksheets(1 ).Activate End If RowR = RowR + 1 Loop End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to write a macro | Excel Discussion (Misc queries) | |||
How do I write a Macro that | Excel Programming | |||
How to write a macro to do... | Excel Programming | |||
Help write Macro | Excel Discussion (Misc queries) | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions |