Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



MS excel url encode

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 17-07-2009
Member
 
Join Date: Jan 2009
Posts: 40
MS excel url encode
  

Hello everyone,
There is a function called url encode in MS excel 2003. Is it also there in MS excel 2007? Can anyone tell me how can i use it?

All suggestions are welcome.

Reply With Quote
  #2  
Old 17-07-2009
Member
 
Join Date: Apr 2008
Posts: 4,642
Re: MS excel url encode

Try the Excel VBA and Excel UserForms Training 1 tool for guideline to use url encode in excel. You can access it from directly from excel tools menu by clicking on the new menu item. It is visual basic editor tool features Objects and Properties, Excel Objects , Object Hierarchy, Application, Workbook, Worksheet, Range, CommandBars, Variables and Constants, Data types, Variable Levels, Declaring Variables, Constants, Loops, Types of Loops, Loop Pitfalls, Effective Decision Making, If/And/Or, Select Case, Dates and Times, Workbook and Worksheet Events, Debugging and Error Handling, Prevention.
Reply With Quote
  #3  
Old 17-07-2009
Member
 
Join Date: May 2008
Posts: 4,344
Re: MS excel url encode

Try the following URL Encoder and Decoder for VB:
Quote:
Public Function URLEncode(StringToEncode As String, Optional _
UsePlusRatherThanHexForSpace As Boolean = False) As String

Dim TempAns As String
Dim CurChr As Integer
CurChr = 1
Do Until CurChr - 1 = Len(StringToEncode)
Select Case Asc(Mid(StringToEncode, CurChr, 1))
Case 48 To 57, 65 To 90, 97 To 122
TempAns = TempAns & Mid(StringToEncode, CurChr, 1)
Case 32
If UsePlusRatherThanHexForSpace = True Then
TempAns = TempAns & "+"
Else
TempAns = TempAns & "%" & Hex(32)
End If
Case Else
TempAns = TempAns & "%" & _
Format(Hex(Asc(Mid(StringToEncode, _
CurChr, 1))), "00")
End Select

CurChr = CurChr + 1
Loop

URLEncode = TempAns
End Function


Public Function URLDecode(StringToDecode As String) As String

Dim TempAns As String
Dim CurChr As Integer

CurChr = 1

Do Until CurChr - 1 = Len(StringToDecode)
Select Case Mid(StringToDecode, CurChr, 1)
Case "+"
TempAns = TempAns & " "
Case "%"
TempAns = TempAns & Chr(Val("&h" & _
Mid(StringToDecode, CurChr + 1, 2)))
CurChr = CurChr + 2
Case Else
TempAns = TempAns & Mid(StringToDecode, CurChr, 1)
End Select

CurChr = CurChr + 1
Loop

URLDecode = TempAns
End Function


' URLDecode function in Perl for reference
' both VB and Perl versions must return same
'
' sub urldecode{
' local($val)=@_;
' $val=~s/\+/ /g;
' $val=~s/%([0-9A-H]{2})/pack('C',hex($1))/ge;
' return $val;
' }
Source: freevbcode.com
Reply With Quote
  #4  
Old 17-07-2009
Member
 
Join Date: May 2008
Posts: 4,562
Re: MS excel url encode

You can get help with the online module on Microsoft office 2007. There are pretty good explanations on how to use tools and features of MS Excel 2007. Check the following link for getting started: http://office.microsoft.com/en-us/ge...938921033.aspx
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "MS excel url encode"
Thread Thread Starter Forum Replies Last Post
How to encode URL in JavaScript and decode in PHP? Linoo Software Development 4 25-02-2010 09:24 PM
How to encode or decode variables in PHP Badrunath Software Development 2 26-08-2009 11:19 PM
How to encode dvd to mp4 Manthan Windows Software 3 21-08-2009 12:45 PM
Encode all videos to 1080p HD dan-dan Hardware Peripherals 3 18-08-2009 11:20 PM
PC crashes when I encode DVD Blazej Hardware Peripherals 4 24-04-2009 09:05 PM


All times are GMT +5.5. The time now is 10:25 PM.