[TC] Gaming Forums
MS Excel Help - Printable Version

+- [TC] Gaming Forums (https://forum.city-driving.co.uk)
+-- Forum: Community Area (/forumdisplay.php?fid=14)
+--- Forum: Off-Topic Chat (/forumdisplay.php?fid=15)
+--- Thread: MS Excel Help (/showthread.php?tid=6639)



MS Excel Help - Ash - 2013-04-02 19:47

Hello Guys!

I'm trying to run a few web queries through an excel spreadsheet. I've got it so I can enter criteria in cell A1, and using VB it will return data I want in the cells underneath.

However I have got various sheets in the work book, I would like to be able type the criteria in one single cell and it copy's it to 1 other cell on each sheet. I've tried to do !Sheet1:A1 and it copy's it fine, however VB does not count it as having any value in it as its simply a copy and paste.

The only work around I have found is to run a macro to copy and paste into all the cells, but I'd rather not use macros.

Has anyone got any ideas?

Thanks! Smile

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1")) _
Is Nothing Then
With QueryTables(1)
.Connection = "URL;http://www.myurlhere.co.uk/" _
& "page.php?page=" & _
Range("A1").Value
.Refresh
End With
End If
End Sub


That's the VB code I currently use if its any help.


RE: MS Excel Help - Pete - 2013-04-02 19:59

I have no idea, it's been a while since I used Excel :/

Wouldn't it be easier to make a web-based solution to scrape the webpages instead?


RE: MS Excel Help - Nammi - 2013-04-02 21:46

have you tried something like this:

define a worksheet variable and use the "for each" command to simply set the values in the relative worksheet?


RE: MS Excel Help - Chuck - 2013-04-03 14:14

*offtopic junk removed*


RE: MS Excel Help - Ash - 2013-04-03 15:07

I worked it out anyway now, just forgot to update thread Smile

Cheers