Extract Data Number to 40 Sheets Placing Only in Cell H12

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all..

i am looking for macro to extract data from sheet1 to multiple sheets (40 sheets) in range/cell H12 for each sheet

Excel 2007
A
1654
210.000
31.000
4762
5345
6112
7200
8678
9456
10324
11234
12etc
Sheet1


after macro :
in sheet 2 :


Excel 2007
H
12654
Sheet2


any help thanks in advance..

m.susanto
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try this:
Code:
Sub PopulateMacro()

    Dim cell As Range
    Dim i As Long
    
    Application.ScreenUpdating = False
    
    For Each cell In Sheets(1).Range("A1:A40")
        i = cell.Row + 1
        Sheets(i).Range("H12") = cell.Value
    Next cell
    
    Application.ScreenUpdating = True
    
End Sub
 
Upvote 0
thanks but not working...
i want extract to 40 sheets in cell H12 for each sheet..
i must insert new sheet before running your macro...
how to automatically insert sheet too....
 
Last edited:
Upvote 0
i must insert new sheet before running your macro...
how to automatically insert sheet too....
Ah, you left that important detail out in your original post! I thought you already had all 40 sheets.
No, matter. Just need to add one line to the code.
Code:
Sub PopulateMacro()

    Dim cell As Range
    Dim i As Long
    
    Application.ScreenUpdating = False
    
    For Each cell In Sheets(1).Range("A1:A40")
        i = cell.Row + 1
[COLOR=#ff0000]        Sheets.Add(After:=Sheets(Sheets.Count)).Name = "Sheets" & i[/COLOR]
        Sheets(i).Range("H12") = cell.Value
    Next cell
    
    Application.ScreenUpdating = True
    
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,356
Messages
6,124,471
Members
449,163
Latest member
kshealy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top