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

I am also attaching the file so you can have a visual on what I am
trying to accomplish.

Thanks in advance.


+-------------------------------------------------------------------+
|Filename: Summary Sheet1.xlsm |
|Download: http://www.thecodecage.com/attachmen...attachmentid=4 |
+-------------------------------------------------------------------+

--
butrfly_kis3
------------------------------------------------------------------------
butrfly_kis3's Profile: http://www.thecodecage.com/forumz/member.php?userid=8
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=25186

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 Paul Excel Worksheet Functions 7 February 21st 09 01:06 AM
If then statements Emily Excel Discussion (Misc queries) 3 March 20th 07 04:48 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
operator statements, shorting when reusing one of the statements? KR Excel Programming 1 August 4th 05 06:20 PM
If Then Statements Wally Steadman[_4_] Excel Programming 3 December 31st 04 08:00 PM


All times are GMT +1. The time now is 04:14 AM.

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"