Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi
Experts I have developed a macro which imports data from another excel file. Ex: consider I have 2 excel files A & B. I run macro in file A today, it copies whatever data from file B. say 20 rows have been filled in file A(starting from A5 to A25). I do some changes on the file A which has few conditional formatting and forlumas. I re-run the macro after 8 days in file A to get the new updated data from file B. The problem I am facing is "If I re-run the macro, it deletes the data from file A. It pastes everything starting from top left cell. When I generated macro in file A, I have selected top left cell while recording macro. My requirement:::::: Now I want the macro to put the data from the cell A27 onwards and also retain the changes to the data from Cell A5 to A25. So everytime I run the macro it should add data to the excel file from the available blank cell and not copy over the same data. Thnanking in anticipation |
#2
![]() |
|||
|
|||
![]()
Minal,
Posting your code would help. But, perhaps a change from code like: Range("A5").Select to Range("A65536").End(xlUp)(2).Select will fix that problem. HTH, Bernie MS Excel MVP "MINAL ZUNKE" wrote in message ... Hi Experts I have developed a macro which imports data from another excel file. Ex: consider I have 2 excel files A & B. I run macro in file A today, it copies whatever data from file B. say 20 rows have been filled in file A(starting from A5 to A25). I do some changes on the file A which has few conditional formatting and forlumas. I re-run the macro after 8 days in file A to get the new updated data from file B. The problem I am facing is "If I re-run the macro, it deletes the data from file A. It pastes everything starting from top left cell. When I generated macro in file A, I have selected top left cell while recording macro. My requirement:::::: Now I want the macro to put the data from the cell A27 onwards and also retain the changes to the data from Cell A5 to A25. So everytime I run the macro it should add data to the excel file from the available blank cell and not copy over the same data. Thnanking in anticipation |
#3
![]() |
|||
|
|||
![]()
hi Bernie
I have pasted code here Windows("Qry_CNC MILL_JOB.xls").Activate Range("A2:E100").Select ActiveWindow.SmallScroll Down:=-87 Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With Selection.Copy Windows("job status xcel.xls").Activate Range("A5").Select ActiveSheet.Paste Range("F7").Select Application.CutCopyMode = False ActiveWorkbook.Save End Sub I hope to have a workable solution from you. thnx "Bernie Deitrick" wrote: Minal, Posting your code would help. But, perhaps a change from code like: Range("A5").Select to Range("A65536").End(xlUp)(2).Select will fix that problem. HTH, Bernie MS Excel MVP "MINAL ZUNKE" wrote in message ... Hi Experts I have developed a macro which imports data from another excel file. Ex: consider I have 2 excel files A & B. I run macro in file A today, it copies whatever data from file B. say 20 rows have been filled in file A(starting from A5 to A25). I do some changes on the file A which has few conditional formatting and forlumas. I re-run the macro after 8 days in file A to get the new updated data from file B. The problem I am facing is "If I re-run the macro, it deletes the data from file A. It pastes everything starting from top left cell. When I generated macro in file A, I have selected top left cell while recording macro. My requirement:::::: Now I want the macro to put the data from the cell A27 onwards and also retain the changes to the data from Cell A5 to A25. So everytime I run the macro it should add data to the excel file from the available blank cell and not copy over the same data. Thnanking in anticipation |
#4
![]() |
|||
|
|||
![]()
Change
Range("A5").Select ActiveSheet.Paste to Range("A65536").End(xlUp)(2).Select ActiveSheet.Paste Bernie "MINAL ZUNKE" wrote in message ... hi Bernie I have pasted code here Windows("Qry_CNC MILL_JOB.xls").Activate Range("A2:E100").Select ActiveWindow.SmallScroll Down:=-87 Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 1 End With Selection.Copy Windows("job status xcel.xls").Activate Range("A5").Select ActiveSheet.Paste Range("F7").Select Application.CutCopyMode = False ActiveWorkbook.Save End Sub I hope to have a workable solution from you. thnx "Bernie Deitrick" wrote: Minal, Posting your code would help. But, perhaps a change from code like: Range("A5").Select to Range("A65536").End(xlUp)(2).Select will fix that problem. HTH, Bernie MS Excel MVP "MINAL ZUNKE" wrote in message ... Hi Experts I have developed a macro which imports data from another excel file. Ex: consider I have 2 excel files A & B. I run macro in file A today, it copies whatever data from file B. say 20 rows have been filled in file A(starting from A5 to A25). I do some changes on the file A which has few conditional formatting and forlumas. I re-run the macro after 8 days in file A to get the new updated data from file B. The problem I am facing is "If I re-run the macro, it deletes the data from file A. It pastes everything starting from top left cell. When I generated macro in file A, I have selected top left cell while recording macro. My requirement:::::: Now I want the macro to put the data from the cell A27 onwards and also retain the changes to the data from Cell A5 to A25. So everytime I run the macro it should add data to the excel file from the available blank cell and not copy over the same data. Thnanking in anticipation |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel could not save all the data and formatting you recently ad.. | Excel Worksheet Functions | |||
Using a MACRO to sort data | Excel Worksheet Functions | |||
help with macro to save repeating data entry | Excel Discussion (Misc queries) | |||
Pulling data from 1 sheet to another | Excel Worksheet Functions | |||
I need a macro to find cut and paste data to new cell | Excel Discussion (Misc queries) |