Excel vba to javascript conversion
- or -
Post a project like this- Posted:
- Proposals: 10
- Remote
- #2697644
- Awarded
Description
I have a small job to convert an excel VBA macro to javascript and embed into webpage.
Background
I have been tasked with converting an excel to web but it contains a macro
Macros will not run in a webpage as they are Microsoft software specific as IM sure you know
I have converted the excel using online tool Spreadsheetconvertor.com (it cannot convert macros)
But, their FAQ says that as a workaround, macros can be converted to Javascript and embedded into the HTML as a 'custom function' (https://www.spreadsheetconverter.com/support/online-help/user-defined-functions/)
So, I would like this vba converted to JS please, added to the html page (and linked to the Update button)
I have supplied the following files
VBA for Java Conversion (With VBA).xlsx - If you amend the file type from .xlsx to .xlsm then the macro will work. I cannot load the .xlsm file on here.
I cannot load the html file either - arrggh. How do we get around this?
Feel free to contact me if you need clarification on anything.
Thanks
Frank
Frank Z.
100% (4)New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
This is more an observation than a question; these are Basic VBA commands/functions; Anymore sophisticated commands/functions may also be available.
Option Compare Text
Sub searchref()
Dim Ref 'Reference number that needs to be searched for
Dim RowCounter_Sh2 'Used to go through each row in sheet2
Dim LastRow_Sh2 'Used to find lastrow entry in sheet2
Dim LastRow_Sh1 'Used to determine the lastrow displayed on sheet1
Dim DisplayRowStart 'Display Rows in sheet1
DisplayRowStart = 14
Ref = Sheet1.Range("A8")
If Ref = "" Or Ref = 0 Then
MsgBox ("Please input Ref number before continuing")
Exit Sub
Else
'Clearing Old Search
LastRow_Sh1 = Sheet1.Cells(Rows.Count, "A").End(xlUp).Row
If LastRow_Sh1 <> 13 Then
Sheet1.Range("A14:G" & LastRow_Sh1).Delete
End If
'Displaying new search
LastRow_Sh2 = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row
For RowCounter_Sh2 = 2 To LastRow_Sh2
If Sheet2.Range("A" & RowCounter_Sh2) = Ref Then
Sheet2.Range("A" & RowCounter_Sh2 & ":G" & RowCounter_Sh2).Copy
Sheet1.Range("A" & DisplayRowStart).PasteSpecial xlPasteAllUsingSourceTheme
DisplayRowStart = DisplayRowStart + 1
End If
Next
End If
End Sub