LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Writing formulae from array to range

I found that data like
=HYPERLINK("https://tfl.gov.uk/bus/stop/490004733D/canada-water-bus-
station?lineId=1", "Canada Water Bus Station stop ?")
were written as strings, rather than formulae.

I NOW have code which seems to work
Static cell(1 To 256) As variant

Why the difference?


When coding for Cell.Formula the entire formula needs to be a string in
VBA. This means the single quotes within the formula require being
wrapped in quotes so they get interpreted correctly. So...

"Canada Water Bus Station stop ?"

...needs to be coded...

"""Canada Water Bus Station stop ?"""

The entire formula needs to be coded as follows...

Cell.Formula = "=HYPERLINK("""https...lineId=1""","""Canada...?"" ")"

I suspect using a variant type causes VBA to sort this out itself,
possibly?

As for emailing.., best to upload a file to a public drop box and
include your email in the file.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing array to a range [email protected] Excel Programming 11 February 19th 16 05:35 AM
variant array with formula strings to range formulae Amedee Van Gasse Excel Programming 4 May 20th 08 09:27 AM
Writing Array To A Named Range IanC Excel Programming 5 April 15th 08 07:34 AM
Writing a range to an array... Alex Excel Programming 2 December 29th 05 01:59 PM
Writing Range to Array Marston Excel Programming 3 August 9th 04 09:11 PM


All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"