In the attached workbook, I needed to make a change to one of the “names” – instead of using the name “Avaya Virtual Host ” – I need to drop the word Avaya and go with just “Virtual Host ”. When I made the change to the command button 1 code (labeled Virtual Hosts), the macro runs as expected. I’m prompted to enter a QTY of hosts and the macro copies rows 27:37 and pastes them immediately below and updates the numerical identifier for that particular host.
The error happens when I go back and try to add any QTY of additional hosts - I get a run-time error 13 “type mismatch”. I’ve looked at the debugger and it points to this line in the code “ Range("A" & y) = "Virtual Host " & Mid(fnd, 20, 999) + z” - I can’t figure out why this is not working when the only thing I’ve changed is the name from “Avaya Virtual Host ” to “Virtual Host ” throughout the code.