Overflow: Run-time error '6'
Easily plot multiple addresses on Google Maps using our free tool.
Overflow: Run-time error '6'
The overflow error occurs because the date in a string format like "20240920", which is not directly convertible to a date using the Format function. You need to first convert this string to a valid date format before applying the Format function.
The correct script:
ExpDate = wsInput.Cells(i, "P").Value
' Convert "YYYYMMDD" to date format
dateValue = DateSerial(Left(rawExpDate, 4), Mid(rawExpDate, 5, 2), Right(rawExpDate, 2))
ExpDate = Format(dateValue, "M/D/YYYY")