| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 94103 | 2008-10-14 14:42:00 | Macros For Microsoft Excel | infinityx8 (14240) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 712252 | 2008-10-14 14:42:00 | Hi There, As you can see I'm new to this forum, so is there anyone out there who is an expert, or slightly more intelligent than me when it comes to Microsoft Excel macros. I'm trying to copy values from "Open Trades" to "Closed Trades" in a spreadsheet, and have created a macro for how to this: Sub Update_Trades() If ActiveSheet.Name <> "Open Trades" Then Exit Sub End If Application.ScreenUpdating = False ActiveCell.EntireRow.Copy Sheets("Closed Trades").Select Range("A" & ActiveSheet.Rows.Count).End(xlUp) _ .Offset(1, 0).EntireRow.Select ActiveSheet.Paste Range("A" & ActiveSheet.Rows.Count).End(xlUp) _ .Offset(1, 0).Select Sheets("Open Trades").Select ActiveCell.EntireRow.Delete Application.CutCopyMode = False Application.ScreenUpdating = True End Sub However, with the line ActiveCell.EntireRow.Delete (in bold), is there a way that I can program the macro to only delete certain cells in the row, instead of the entire row, e.g. only cells in columns E,F,G,H and K? Thanks in advance - any help at ALL will be appreciated!!!! :clap |
infinityx8 (14240) | ||
| 712253 | 2008-10-14 18:55:00 | If it is the last row in column A you want to delete the selected cells in try Range("A10000").End(xlUp).Range("e1:h1,k1").ClearContents HTH |
rad_s4 (7401) | ||
| 1 | |||||