I have an excel data that contains range from A40 to G1330, but the actual range is from A40 to G63 because the remaining range has formula but the cell is empty “I applied the formula IFERROR make the cell empty”
also I have an exsist powerpoint file and slide number 3 contains of a table with name “Table 1”
what I want is to fill the table which is in the powerpoint file from the excel range from range D40 to E63
I have tried the following code
Dim Name_Attendees_lastVal As Range
Dim sht As Worksheet
Dim pptapp As PowerPoint.Application
Dim presentation As PowerPoint.presentation
Dim ppslide As PowerPoint.Slide
Dim slidetitle As String
Dim pptfile As String
Dim slideCtr As Integer
Set sht = Sheets("Reports")
Set Name_Attendees_lastVal = sht.Columns(5).Find("*", sht.Cells(1, 2), xlValues, xlPart, xlByColumns,xlPrevious)
sht.Range("D40", Name_Attendees_lastVal).Resize(, 2).Select
pptfile = "C:UsershabinalshaikhDesktopTrainingpresentation makerCourse Report.pptx"
Set pptapp = CreateObject("PowerPoint.Application")
pptapp.Visible = True
pptapp.Presentations.Open (pptfile)
for i = 40 to Set Name_Attendees_lastVal = sht.Columns(5).Find("*", sht.Cells(1, 2), xlValues, xlPart, `xlByColumns, xlPrevious).count
‘ this code is to count the number of rows, but it doesn’t work
pptapp.ActivePresentation.Slides(3).Shapes("Table 1").TextFrame.TextRange.Characters.Text = `ThisWorkbook.Sheets("Reports").Range("D"&i)
‘ this code is to fill the table which is in the PowerPoint file with the names in the excel sheet
next
for y = 40 to Set Name_Attendees_lastVal = sht.Columns(5).Find("*", sht.Cells(1, 2), xlValues, xlPart, `xlByColumns, xlPrevious).count
‘ this code is to count the number of rows, but it doesn’t work
pptapp.ActivePresentation.Slides(3).Shapes("Table 1").TextFrame.TextRange.Characters.Text = ThisWorkbook.Sheets("Reports").Range("E"&i)
‘ this code is to fill the table which is in the PowerPoint file with the Attending status in the excel sheet
next