Is there a way to do something similar in Office scripts/Powerautomate

c3rberus

New Member
Joined
Mar 24, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
so i have this vba script
VBA Code:
Sub import()
    Application.DisplayAlerts = False 'switching off the alert button
    Application.ScreenUpdating = False
    Dim fName As String, wb As Workbook, sh As Worksheet
    Dim lastRow As String
    MsgBox "Select the List"
    Application.ScreenUpdating = False
    fName = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
    If fName <> "" Then
        Set wb = Workbooks.Open(fName)
        wb.Sheets(1).Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
        wb.Close False
        Sheets("Data").Select
        Sheets("Data").Name = "List"
        lastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row + 1
        Range("A" & lastRow).Select
        ActiveCell.FormulaR1C1 = "fill"
    
    End If
    
    Sheets("List").Select
    Range("A3:EP3").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Sheets("Tellingen").Select
    lastRow = ActiveSheet.Cells(Rows.Count, "I").End(xlUp).Row
    Range("I" & lastRow).Select
    ActiveSheet.Paste
    Sheets("List").Select
    Application.CutCopyMode = False
    ActiveWindow.SelectedSheets.Delete
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True 'switching on the alert button
End Sub

But some of the users of this file want it to be useable on web,
for this i would like to know if there is an equivalent way to do this with either office scripts or power automate
i dont know if this is even possible.
any advice or solutions are appreciated
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
This looks like the kind of task OfficeScripts or officeJS or whatever its called now should be able to do. Frankly, I'd be surprised if it can't.

All I can suggest is try looking for tutorials or official documentation from Microsoft about how to code OfficeScripts and take it from there. Last time I looked (a year or two ago), I couldn't really find much information but maybe that has changed.
 
Upvote 0
This looks like the starting point:


It seems it's limited to those who have an enterprise or education account, so that rules me out. There is an action recorder it seems, so that should help.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top