Modificaciones para macro de sendkeys
Tengo una macro que hice con ayuda de este foro (agradecidisimooo por ello) y quiero hacerle unas modificaciones, para lo cual consulto de nuevo con uds.
Sub CrearPdfs()
Dim Resp As Byte
Resp = MsgBox("Deseas continuar con la ejeción de la macro?", _
vbQuestion + vbYesNo, "EXCELeINFO")
If Resp = vbYes Then
SendKeys "%{TAB}", True 'Alt+Tab (Cambiar a ventana gas)
Dim x As Long
For x = 97 To 217
Application.Wait (Now + TimeValue("0:00:2"))
SendKeys "%", True 'Alt
Application.Wait (Now + TimeValue("0:00:3"))
SendKeys "p", True
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys "r", True
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys ActiveSheet.Range("A" & x).Value, True
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys "{enter 2}", True
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys "{tab 6}", True
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys ActiveSheet.Range("B" & x).Value, True
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys "{enter}", True 'OK FINAL
Application.Wait (Now + TimeValue("0:00:4"))
Next x
SendKeys "%{TAB}", True
MsgBox "Proceso Finalizado", vbInformation, "SALUDOS"
Else
MsgBox "Se eligió cancelar...", vbCritical, "EXCELeINFO"
End If
End SubEn la linea donde dice "For x = 97 To 217" quisiera saber si puedo poner esos datos en celdas de excel, porque lo modifico seguido y para no andar entrando y saliendo del VBA me seria mas facil poner por ejemplo: en la celda E2 "DESDE" y en E3 el valor que seria en este caso 97, y luego en E3 "HASTA" y al lado el valor que ahora es 217.
Y la otra duda que tengo es que quiero agregar un click, pero busque como es y cuando lo escribo me da error.
For x = 97 To 217
Application.Wait (Now + TimeValue("0:00:2"))
SendKeys "{Clickleft}", True '
Application.Wait (Now + TimeValue("0:00:2"))
SendKeys "%", True 'Alt
En negrita esta lo que quise agregar.