Macro Help

zbiris

New Member
Joined
Apr 24, 2019
Messages
7
Hello,

I need help from the experts.

I'm creating an inventory file for all users and I have the main sheet called "Users" where I have a table with the names of the users in the column A, starting in the cell A1 and goes to A200.

I need to create a new sheet using the sheet called "Template" with the name of the cell.

And after that I need that the text in the cell A1 goes to the cell C4 on the new sheet created.

Can you help me please?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I need to create a new sheet using the sheet called "Template" with the name of the cell.

with the name of what cell? the active cell?
a cell in a sheet called template?
whats in "template"? or are we creating template and then naming a cell?

please clarify that line
 
Upvote 0
Hi & welcome to MrExcel.
How about
Code:
Sub zbiris()
   Dim Cl As Range
   For Each Cl In Sheets("Users").Range("A1", Sheets("Users").Range("A" & Rows.count).End(xlUp))
      If Cl.Value <> "" Then
         If Not Evaluate("isref('" & Cl.Value & "'!A1)") Then
            Sheets("Template").Copy , Sheets(Sheets.count)
            ActiveSheet.Name = Cl.Value
            ActiveSheet.Range("C4").Value = Cl.Value
         End If
      End If
   Next Cl
End Sub
 
Upvote 0
I have a table in the sheet "Users"

The column A should be the name of the new sheets that are a copy from the sheet "Template".

And for example the cell A1 in the sheet "Users" with the text "Zbiris" should appear in the cell C4 in the new sheet "Zbiris".
 
Upvote 0
Hi & welcome to MrExcel.
How about
Code:
Sub zbiris()
   Dim Cl As Range
   For Each Cl In Sheets("Users").Range("A1", Sheets("Users").Range("A" & Rows.count).End(xlUp))
      If Cl.Value <> "" Then
         If Not Evaluate("isref('" & Cl.Value & "'!A1)") Then
            Sheets("Template").Copy , Sheets(Sheets.count)
            ActiveSheet.Name = Cl.Value
            ActiveSheet.Range("C4").Value = Cl.Value
         End If
      End If
   Next Cl
End Sub

That's it.

Two more things.

I want to copy the cell a2 and b2 to c4 and d4 in the othe sheet and I want to go to the last sheet created.
 
Upvote 0
How about
Code:
Sub zbiris()
   Dim Cl As Range
   
   For Each Cl In Sheets("Users").Range("A1", Sheets("Users").Range("A" & Rows.count).End(xlUp))
      If Cl.Value <> "" Then
         If Not Evaluate("isref('" & Cl.Value & "'!A1)") Then
            Sheets("Template").Copy , Sheets(Sheets.count)
            ActiveSheet.Name = Cl.Value
            ActiveSheet.Range("C4:D4").Value = Cl.Resize(, 2).Value
         End If
      End If
   Next Cl
End Sub
 
Upvote 0
How about
Code:
Sub zbiris()
   Dim Cl As Range
   
   For Each Cl In Sheets("Users").Range("A1", Sheets("Users").Range("A" & Rows.count).End(xlUp))
      If Cl.Value <> "" Then
         If Not Evaluate("isref('" & Cl.Value & "'!A1)") Then
            Sheets("Template").Copy , Sheets(Sheets.count)
            ActiveSheet.Name = Cl.Value
            ActiveSheet.Range("C4:D4").Value = Cl.Resize(, 2).Value
         End If
      End If
   Next Cl
End Sub

I want this

A1 from Users goes to C4 in the new sheet
B1 from Users goes to H4 in the new sheet
C1 from Users goes to H6 in the new sheet
D1 from Users goes to D6 in the new sheet
 
Upvote 0
Are you sure that this is correct, as it's now the third different set of information that you have supplied?
Also when you say A1, B1 etc, do you actually mean that or do you mean the values from col A:D on the row with the user name?
 
Upvote 0
Pretty confuse I know, sorry.

I want like this:
A1 from Users goes to C4 in the new sheet
B1 from Users goes to H4 in the new sheet
C1 from Users goes to H6 in the new sheet
D1 from Users goes to D6 in the new sheet

Basically its one row to 4 cells in the sheet created for each user.
 
Upvote 0
Can you please answer the 2nd part of my question? :)
 
Upvote 0

Forum statistics

Threads
1,215,388
Messages
6,124,658
Members
449,177
Latest member
Sousanna Aristiadou

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