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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,884
Messages
6,181,558
Members
453,053
Latest member
Kiranm13

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