Archive for the ‘IT’ Category.

Updating specific fields in SQL database

Use following instructions and if you don't want to change all records remember to include the where statement.

UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value

Comparing excel lists

Use following formula to determine whether a value in one column is in another column and if not then return 1

=IF(IFERROR(MATCH(A2,B$2:B$4117,0),-1)=-1,1,”")

Removing tabs in excel cells

Sometimes when you are preparing your internet marketing data for upload to your site you need to remove tabs from you site so your database etc does not get confused

use the excel clean() function

Excel write limit

This is a useful macro but be aware that the field limit is 1028 characters!

Excel reversing digits

Sometimes when you are using internet marketing you need to understand difficult functions in excel to keep you one step ahead of the competition.  This one entered as an array reverses the digits in a number.

=SUM(VALUE(MID(A1,ROW(INDIRECT(”1:”&LEN(A1))),1))*10^(ROW(INDIRECT(”1:”&LEN(A1)))-1))

Generally this works fine except for when number ends withn zero

Automatic excel image insertion

Given a long list of urls in an excel spreadsheet this macro will automatically insert their related images into adject cells.

Sub imageExport()

Dim i
i = 1

Dim bContinue
bContinue = True

While bContinue
snapshot = Cells(i, 1).Value
If snapshot = “” Then
bContinue = False
Else
Cells(i, 2).Select
ActiveSheet.Pictures.Insert(snapshot).Select
i = i + 1
End If
Wend

End Sub

exporting excel images to files

Sub ExportMyPicture()

Dim MyChart As String, MyPicture As String
Dim PicWidth As Long, PicHeight As Long

Application.ScreenUpdating = False
On Error GoTo Finish

MyPicture = Selection.Name
With Selection
PicHeight = .ShapeRange.Height + 8
PicWidth = .ShapeRange.Width + 8
End With

Charts.Add
ActiveChart.Location Where:=xlLocationAsObject, Name:=”Sheet1″
Selection.Border.LineStyle = 0
MyChart = Selection.Name & ” ” & Split(ActiveChart.Name, ” “)(2)

With ActiveSheet
With .Shapes(MyChart)
.Width = PicWidth
.Height = PicHeight
End With

.Shapes(MyPicture).Copy

With ActiveChart
.ChartArea.Select
.Paste
End With

.ChartObjects(1).Chart.Export Filename:=”MyPic.jpg”, FilterName:=”jpg”
.Shapes(MyChart).Cut
End With

Application.ScreenUpdating = True
Exit Sub

Finish:
MsgBox “You must select a picture”
End Sub

moblog testing

Wanted to be able to publish posts away from pc and have just spent quite a while trying to get moblog working on my xda orbit - kept getting an error when I was trying to retrieve blogs when setting up profile. the error was “there was an error”.
anyway looked at loads of posts but couldn’t find anything. well, I got it sorted now. as with a lot of things it’s v simple when you know the answer. I had to enable xml-rpc remote connections on wordpress settings. obvious really I suppose !

Posted from moBlog – mobile blogging tool for Windows Mobile