incomplete code

  • Thread starter Thread starter tim64
  • Start date Start date
T

tim64

I have this code I've been working on and it dosn't work


Code:
--------------------

Sub MakeHyperlink()
Range("B8").Select

Do Until ""
Application.OnKey "F2"
Application.OnKey "HOME"
Application.OnKey "Del"
Application.OnKey "Enter"
ActiveCell.Offset(0, 1).Select
Loop

End Sub
 
Do Until ""
Application.OnKey "F2"
Application.OnKey "HOME"
Application.OnKey "Del"
Application.OnKey "Enter"
ActiveCell.Offset(0, 1).Select
Loop


what you are trying to do with do until "" (what is the condition)

what exactly are you trying to do inside do loop
 
I have a list of names I'm using this on and I want it to do tha
process until there is nothing in the selected box (it's sopose to g
down one each loop
 
We are trying to go through a undefined range of cells and do som
editing on them until there are blanks in the process, which at tha
time the procedure should stop. Do you know how to do this
 
I made a minor change, I am not sure what you are trying to do using
Application.OnKey "{F2}"....


Sub MakeHyperlink()
Range("B8").Select

Do Until ActiveCell.Value = ""
Application.OnKey "{F2}"
Application.OnKey "{HOME}"
Application.OnKey "{Del}"
Application.OnKey "{Enter}"
ActiveCell.Offset(0, 1).Select
Loop

End Sub
 
what I'm trying to do is simulate key pressing. Like the computer
presses the key for me. I've updated the code realizing what OnKey
does, but it doesn't work.



Code:
--------------------

Sub MakeHyperlink()
Range("B8").Select

Do Until ActiveCell.Value = ""
SendKeys "{F2}[, true]"
SendKeys "{HOME}[, true]"
SendKeys "{Del}[, true]"
SendKeys "{Enter}[, true]"
ActiveCell.Offset(1, 0).Select
Loop

End Sub
 
I am not sure if this is what you looking for

Sub MakeHyperlink()
Range("B8").Select

Do Until ActiveCell.Value = ""
SendKeys "{F2}"
SendKeys "{HOME}"

SendKeys "{Del}"

SendKeys "{Enter}"
ActiveCell.Offset(1, 0).Select
Loop

End Sub
 
There might be better ways of accomplishing the same thing without using
sendkeys.

If you post a few examples of what's in those cells (and what should be
deleted), it might be easier to follow.

(and you want a hyperlink when you're done, too? mailto://, I bet???)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top