Dim wsSheet As WorkSheet
Set wsSheet = wb.Sheets("Sheet1")
wsSheet.Cells(Sheet1.Cells(Sheet1.Rows.Count, "B").End(xlUp).Row + 1, "B").Value = Staff_Name(0)
It is just that you are mixing the sheets codename with the sheets tab name and they can refer to different sheets (the sheets codename is the name that appears outside the brackets when you look in the VBE project window (the tab name is the name inside the brackets btw)).
See the image below for an example.
You should really use one or the other so in your case...
VBA Code:
Dim wsSheet As Worksheet
Set wsSheet = wb.Sheets("Sheet1")
wsSheet.Cells(wsSheet.Cells(wsSheet.Rows.Count, "B").End(xlUp).Row + 1, "B").Value = Staff_Name(0)
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.