save\change sheet name

  • Thread starter Thread starter יריב החביב
  • Start date Start date
×

יריב החביב

Hello,

We get emulation report on excel from oracle softwere

and we link it to access database.

we save (with excel macro ) the report to name that access "know",

but it is not enough, because the sheet of the excei file change it's name

with every report and access dont recognize those names.

(it recogize the name 'sheet 1' ).

How do i save the excel sheet name ( with macro code )

to the name 'sheet 1' witout having known the sheet name ?
(original from emulation)

Thank you
 
You can try this. If the sheet always the first sheet in the workbook, if so
you can use this to see the Sheet Name:

Sub WksName()

MsgBox Worksheets(1).Name

End Sub

or if you want to know the name of every worksheet in the workbook you can
you this:

Sub WksName()

Dim i As Long

For i = 1 To Worksheets.Count
MsgBox Worksheets(i).Name
Next i

End Sub


Hope this helps!
 
I read what you wanted again and maybe this is what you wanted

Sub WksName()

'this will change the first sheets name to "Sheet1"
Worksheets(1).Name = "Sheet1"

End Sub

Hope this helps! If so, please click "Yes" this was helpful.
 
Back
Top