Excel & Sharepoint

samunders

New Member
Joined
May 26, 2020
Messages
27
Office Version
  1. 2019
Hello All,

I wonder if someone can help me with an Issue with macros on Sharepoint.

before being migrated to share point we had a shared Excel sheet where there were macro buttons that copies text from one cell and pasted it on the the sheets where the button one in the active cell.

i understand that macros don't work in Excel online but there is the Power Automate ability.

The old macro was:
VBA Code:
Sub APR6TH()
'
' Macro1 Macro
'
    Sheets("data").Select
    Range("f1").Select
    Selection.Copy
    Sheets("APR").Select
     ActiveSheet.Paste

End Sub

I want to write several scripts that do the same job but I can't seem to get them to paste in the "active cell" they see to always default to the same cell.

VBA Code:
function main(workbook: ExcelScript.Workbook) {
  let selectedSheet = workbook.getActiveWorksheet();
  let data = workbook.getWorksheet("Data");
  selectedSheet.getRange("c5").copyFrom(data.getRange("A1"), ExcelScript.RangeCopyType.values, false, false);
}

the issues is with the selectedsheets.getrange("c5")

what do I replace that with?

I'm very new to this sharepoint business so any help is great
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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