Home > database >  wsSheetname change issue
wsSheetname change issue

Time:01-26

I found some code online, but when I change it, it will not work. The code is for filling pdf forms with Excel.

At the top of the code is:

    'Find the last row of data in sheet Write.
    With shWrite 'the sheet named Write
        .Activate
        LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
    End With

I have created another sheet named Test When I change the sheetname from shWrite to shTest the code stops working.

What am I doing wrong?

CodePudding user response:

You seem to be using the tutorial from

https://myengineeringworld.net/2013/10/read-and-write-pdf-forms-from-excel-vba.html

This does not appear to have example sheets prior to running they seem to be embedded in the macro.

sheetPr codeName="shWrite"

So if you wish to alter the tutorial sheet names you may need to alter the macro or rename the sheets and macro components.

I dont have time to follow the full tutorial, that is for your learning, but suggest you watch for where and how to reuse for your own sheet names is defined.

CodePudding user response:

I found I should rename the properties of the Test sheet. Renamed (Name) to shTest Renamed Name to Test

In the VBA code replaced shWrite with shTest

the code works wonderful now.

  •  Tags:  
  • Related