Uzma Shaheen
Active Member
- Joined
- Nov 10, 2012
- Messages
- 484
- Office Version
- 365
- 2021
- Platform
- Windows
- Mobile
- Web
Hi all -
Im trying to resize my chart but this aint working coming up with the error message "the item specified werent found"
Here is the code
Im trying to resize my chart but this aint working coming up with the error message "the item specified werent found"
Here is the code
Code:
Public Sub test2()
Dim rngPaste As Range
Dim StartCell As Long
Dim EndCell As Long
Worksheets("Daily1").Range("C195:E200").ClearContents
StartCell = Worksheets("Daily1").Range("C194").Value
EndCell = Worksheets("Daily1").Range("d194").Value
Set rngPaste = Worksheets("Daily1").Range("C195")
Worksheets("Daily1").Cells(195, StartCell).Resize(6, EndCell).Copy
rngPaste.PasteSpecial xlPasteValuesAndNumberFormats
Worksheets("DailyView1").ChartObjects("WkChart").Chart.SetSourceData Source:=Sheets("Daily1").Range("B195:B200").Resize(, EndCell)
End Sub