Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Help on VBA Code to populate multiple sheets

I need to write VBA codes to handle the following situation.

There are two sheets S1(Summary Info), and S2(Detail for creating new
sheets)

On S1, I summarizes inf as follow

NewSheetName CellRangeFromS2
A A2.K12
B A13.K19
C A20.K35

So, how can I create additional sheets A, B, C and paste all info
referred above in Cell A1.

I had diffcult time to do the loop through. Any help is greatly
appreciated. My email is . Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 367
Default Help on VBA Code to populate multiple sheets

On Jan 15, 12:51*pm, wrote:
I need to write VBA codes to handle the following situation.

There are two sheets S1(Summary Info), and S2(Detail for creating new
sheets)

On S1, I summarizes inf as follow

NewSheetName * CellRangeFromS2
A * * * * * * * * * * * * * *A2.K12
B * * * * * * * * * * * * * *A13.K19
C * * * * * * * * * * * * * *A20.K35

So, how can I create additional sheets A, B, C and paste all info
referred above in Cell A1.

I had diffcult time to do the loop through. Any help is greatly
appreciated. My email is . Thanks.


Hope i understood you correctly

Sub create()

Dim S1 As Worksheet
Dim S2 As Worksheet
Dim newS As Worksheet
Dim tmpStr As String

Set S1 = Worksheets("S1")
Set S2 = Worksheets("S2")

For i = 2 To S1.Cells(65536, 1).End(xlUp).Row
Set newS = Worksheets.Add(After:=Worksheets(Sheets.Count))
newS.Name = S1.Cells(i, 1)
tmpStr = S1.Cells(i, 2).Value
If InStr(tmpStr, ".") 0 Then
tmpStr = Replace(tmpStr, ".", ":")
S2.Range(tmpStr).Copy newS.Range("A1")
End If
Next i

End Sub

hth
Carlo
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
Use a code to populate a cell with a specific value braveT Excel Worksheet Functions 5 April 13th 07 10:02 PM
How to populate sheets from a specified set of cells.. neilcarden Excel Worksheet Functions 0 June 21st 06 07:39 PM
VBA code to populate 1000's of cells? [email protected] Excel Discussion (Misc queries) 14 March 31st 06 06:12 AM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
How am i able to populate a sumation for multiple sheets swiftcode Excel Worksheet Functions 2 September 29th 05 02:33 AM


All times are GMT +1. The time now is 07:16 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"