excel - Renaming the multiple sheets with the month extracted from respective columns -


i have 10 sheets in same workbook. each sheet contains data specific month (10 different months). if have time format dd/mm/yyyy hh:mm in column d , have dynamic number of rows. want code read month number column d , rename sheet month name respectively.

how can accomplish this?

to iterate on worksheets use simple for loop

 each ws in worksheets 

inside loop, select sheet

      sheets(ws.name).select 

and extract month

      sheetdate = range("d1").value       mn = monthname(month(sheetdate)) 

finally, rename worksheet

      activesheet.name = mn 

and close loop

  next ws 

so, putting pieces , simplifying code, try this

  each ws in worksheets       ws.name =monthname(month(ws.range("d1").value))   next ws 

Comments