Groups | Search | Server Info | Login | Register
| Newsgroups | comp.sources.d |
|---|---|
| Date | 2015-08-02 23:36 -0700 |
| References | <18d38bdd-bc1e-43d3-a08b-beb5ebd882c5@googlegroups.com> |
| Message-ID | <af22f8b8-0180-4e25-882a-090d673694f3@googlegroups.com> (permalink) |
| Subject | Re: WORD macro that spits out a copy-pastable message box |
| From | sandeep6699@yahoo.com |
Thanks Auric
On Friday, July 3, 2015 at 10:38:09 AM UTC-5, Auric__ wrote:
>
> If you use the ClipBoard_SetData() function from this page (watch the
> wordwrap):
>
> http://stackoverflow.com/questions/14219455/excel-vba-code-to-copy-a-
> specific-string-to-clipboard
>
> ...you can copy the URL straight to the clipboard:
>
> Sub IMDB()
> ' Create IMDB query to retrieve the highest rated movies in a user-
> ' selected year, with user rating between 6.9 and 10
> Dim sText As String
> sText = InputBox("Enter movie release year")
> 'sanity checks included
> If (sText <> vbNullString) And (sText > 1886) And _
> (sText <= Year(Now)) Then
> sText = _
> "http://www.imdb.com/search/title?at=0&languages=en%7C1&release_date=" _
> + sText + "-01-01," + sText + _
> "-12-31&sort=user_rating&title_type=feature&user_rating=6.9,10"
> ClipBoard_SetData sText
> MsgBox sText
> End If
> End Sub
>
> (There are simpler ways to copy to the clipboard; the above URL discusses
> some.)
>
> Personally, I'd include an option for the ranks. Something like...
>
> ratingRange = InputBox( _
> "Enter the desired range of ratings separated by a comma, (e.g. 6.9,10).")
> '...
> sText = _
> "http://www.imdb.com/search/title?at=0&languages=en%7C1&release_date=" _
> + sText + "-01-01," + sText + _
> "-12-31&sort=user_rating&title_type=feature&user_rating=" & ratingRange
Back to comp.sources.d | Previous | Next — Previous in thread | Find similar
WORD macro that spits out a copy-pastable message box sandeep6699@yahoo.com - 2015-07-03 04:11 -0700 Re: WORD macro that spits out a copy-pastable message box sandeep6699@yahoo.com - 2015-08-02 23:36 -0700
csiph-web