Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use a code to populate a cell with a specific value | Excel Worksheet Functions | |||
How to populate sheets from a specified set of cells.. | Excel Worksheet Functions | |||
VBA code to populate 1000's of cells? | Excel Discussion (Misc queries) | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Worksheet Functions | |||
How am i able to populate a sumation for multiple sheets | Excel Worksheet Functions |