Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF Then Statements
I am trying to create a macro based on a summary sheet with the field
description-there are options to insert extra lines if needed, however at each description entered I want to have it insert a range called "Worksheet" with each description being placed in the first row. IE Summary sheet- (Description column) Example 1 Example 2 Example 3 Example 4 Worksheet 1 (Description Column) Example 1 Worksheet 2 (Description Column) Example 2 Worksheet 3 (Description Column) Example 3 Worksheet 4 (Description Column) Example 4 So far this is the code I have created: Sub Insert_Worksheets() Dim R As Integer Dim Sum_Description As String Dim Worksheet_Num As Integer Dim N As Integer Dim First_Cell As Range Dim J As Integer Range("First_Cell") = Worksheets("Summary").Columns("C").Rows("7") Range("First_Cell").Activate R = 7 N = 1 Range("Worksheet_Num") = N Application.ScreenUpdating = False Do Until (IsEmpty(Cells(R, 3))) If Range("Sum_Description") = " " Then Range("Worksheet").Copy Range("Summary_Sheet").Insert shift:=xlShiftDown, copyorigin:=True Range("Sum_Description").Select Selection.Copy Range("Description").PasteSpecial xlPasteValues, xlPasteSpecialOperationNone R = R + 22 N = N + 1 Range("Worksheet_Num") = N ActiveCell.Offset(1, 0).Select End If Loop End Sub Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
if then statements | Excel Worksheet Functions | |||
If statements | Excel Worksheet Functions | |||
IF Statements (Mutliple Statements) | Excel Worksheet Functions | |||
How My If Or Statements | Excel Worksheet Functions | |||
operator statements, shorting when reusing one of the statements? | Excel Programming |