Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
if then statements BC Excel Worksheet Functions 2 April 30th 09 11:37 PM
If statements jonssmaster Excel Worksheet Functions 4 November 26th 08 02:58 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
How My If Or Statements John Excel Worksheet Functions 1 April 24th 06 07:50 PM
operator statements, shorting when reusing one of the statements? KR Excel Programming 1 August 4th 05 06:20 PM


All times are GMT +1. The time now is 10:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"