Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to insert a column...
i need a bit of clarification with this please: i need to select col A:B on sheet "Breakdown" if A:B empty then insert col C from sheet "Data" into A (leaving B empty) but, if there's data in A:B, insert 2 columns and move A:B to the right (so now the data from a:b will be c:d) and insert col C from sheet "Data" thanks! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to insert a column...
works like a charm! but if anyone can point out flaws, errors or corrections i'd be greatful as well... :D Sub IsThere() Application.ScreenUpdating = False Sheets("Breakdown").Select Range("A1:B1").Select If Selection.Text = "" Then GoTo Insert Else Columns("A:B").Select Selection.Insert Shift:=xlToRight End If Insert: Sheets("Data").Select Range("C1").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Sheets("Breakdown").Select Range("A2").Select ActiveSheet.Paste Application.CutCopyMode = False Columns("A:A").EntireColumn.AutoFit Range("B2").Select Application.ScreenUpdating = True End Sub ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert Column after specific text title the new column and add for | Excel Discussion (Misc queries) | |||
insert a blank column between each column in a data file | Excel Discussion (Misc queries) | |||
insert row / insert column command buttons | Excel Worksheet Functions | |||
Insert blank column every other column | Excel Discussion (Misc queries) | |||
Can't insert column | Excel Discussion (Misc queries) |