help for CELL reference in power query

**recorded in macro**

workbook  name = AutoSched

sheet name where table loads = schedule

cell reference  =  sheet name “Shift Sched”  cell = A1

A1 has a link to file that keeps changing with date. so weblink has to be copied from cell A1.

**code to change**

 

ActiveWorkbook.Queries.Add Name:=”Schedules (2)”, Formula:= _ “let” & Chr(13) & “” & Chr(10) & “ Source = Excel.Workbook(Web.Contents(“”https://dawn.com/Shift Schedules/Shift Schedules and Emp Details w.e.f May 06, 2018-HYD.xlsx””), null, true),” & Chr(13) & “” & Chr(10) & ” Schedules_Sheet = Source{[Item=””Schedules””,Kind=””Sheet””]}[Data],” & Chr(13) & “” & Chr(10) & ” #””Changed Type”” = Table.TransformColumnTypes(Schedules_Sheet,{{“”Column1″”, type text}, {“”Column2″”, type” & _ ” text}, {“”Column3″”, type text}, {“”Column4″”, type any}, {“”Column5″”, type text}, {“”Column6″”, type text}, {“”Column7″”, type any}, {“”Column8″”, type any}, {“”Column9″”, type text}, {“”Column10″”, type text}, {“”Column11″”, type text}, {“”Column12″”, type text}, {“”Column13″”, type text}, {“”Column14″”, type text}, {“”Column15″”, type text}, {“”Column16″”, type” & _ ” text}, {“”Column17″”, type text}, {“”Column18″”, type text}, {“”Column19″”, type any}, {“”Column20″”, type text}, {“”Column21″”, type text}, {“”Column22″”, type text}, {“”Column23″”, type any}, {“”Column24″”, type any}, {“”Column25″”, type any}, {“”Column26″”, type any}, {“”Column27″”, type any}, {“”Column28″”, type any}, {“”Column29″”, type any}, {“”Column30″”, ty” & _ “pe any}, {“”Column31″”, type text}, {“”Column32″”, type any}, {“”Column33″”, type text}, {“”Column34″”, type text}, {“”Column35″”, type text}, {“”Column36″”, type any}, {“”Column37″”, type text}, {“”Column38″”, type text}, {“”Column39″”, type any}, {“”Column40″”, type any}, {“”Column41″”, type any}, {“”Column42″”, type text}, {“”Column43″”, type any}})” & Chr(13) & “” & Chr(10) & “in” & Chr(13) & “” & Chr(10) & ” #””C” & _ “hanged Type”””

Participant Asked 8 hours ago in VBA.
Add Comment
0 Answer(s)
  • Found this useful?

    Please share using the share button above.

    If you found the answer is best answer for your question, Please mark as 'best answer' by clicking on the right tick mark icon at the left side of the answer.

    Found the answer useful and wants to credit the user, then vote the answer (vote up).

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.