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?
 
The values from col

A B C D
User1Test1Access1Confirmation1
User2Test2Access2Confirmation2
User3Test3Access3Confirmation3

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

Want the sheet User1 to have the User1 text in the cell c4 the Test1 in the cell H4 text Access1 in the cell H6 and text Confirmation1 in cell D6 and forwards. User2 data in the sheet User2
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
In that case, try
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)
            With ActiveSheet
               .Name = Cl.Value
               .Range("C4").Value = Cl.Value
               .Range("H4").Value = Cl.Offset(, 1).Value
               .Range("H6").Value = Cl.Offset(, 2).Value
               .Range("D6").Value = Cl.Offset(, 3).Value
            End With
         End If
      End If
   Next Cl
End Sub
 
Upvote 0
In that case, try
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)
            With ActiveSheet
               .Name = Cl.Value
               .Range("C4").Value = Cl.Value
               .Range("H4").Value = Cl.Offset(, 1).Value
               .Range("H6").Value = Cl.Offset(, 2).Value
               .Range("D6").Value = Cl.Offset(, 3).Value
            End With
         End If
      End If
   Next Cl
End Sub

That's perfect, thanks
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,216,158
Messages
6,129,207
Members
449,493
Latest member
JablesFTW

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