You are here:

Excel/Set Cell value based on new sheet


Master Sheet
Master Sheet  

Bonus Calculation
Bonus Calculation  
Dear Aidan,

thank you so much for your great respond.
I inserted the code provided by you :

Dim mysht As Worksheet
Set mysht = Worksheets("Master")
Dim n As Long
n = 4
While Len(mysht.Cells(n, 1).Value) > 0
   Worksheets("Emp").Copy After:=Worksheets("Master")
   ActiveSheet.Name = mysht.Cells(n, 1).Value
   n = n + 1

and it was work perfectly, my second issue was:
after creating a new sheet for each employee (have his name), I want cell (d7) in each new sheet to have the same employee name as well. and cell (d5) to have his subsidiary name.
then after calculating his bonus, the result should go back to master sheet. I inserted two screenshot for both sheets to better clarify of my issue.

Thanks & Regards

My eyesight isn't what it once was (!) so I have problems with the images on this system - however, to set a value on the new sheet

ActiveSheet.range("D7).value = "whatever you want"

would be a method I would use - for the bonus calculation, are it would work the other way round


or similar - hopefully this gives you what you need - but let me know if I can help further.
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Aidan Heritage


I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards. I'm based in the UK, so please allow for time differences when asking me questions from other parts of the world! As AllExperts closes down, just google me to find my details - I will still be around answering questions!


My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2017 All rights reserved.

[an error occurred while processing this directive]