Table format

Clarab9

New Member
Joined
Sep 27, 2020
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I currently have data added to my excel spreadsheet table through process flow. When a form is completed in forms the data entered populates into the fields of my spreadsheet.

Now when the data is added to the excel table a new row is created at the bottom of the table. As the new data is date related, I would like the new row to start at the top of the table so it is in chronological order.

I am aware you can use the sort function but as this automatically populates I would like it hard coded.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
when the data is added to the excel table a new row is created at the bottom of the table.
unless you're not working with a real table(=listobject) adding your data is with ".listrows.add.range.cells(1); ... to add a row at the end.

By adding a listrow with index 1, you 're adding (inserting) in the 1st row.

Is it a listobject ?
 
Upvote 0
Hello @BSALV
Apologies for the late reply.

I have googled the terminology you have used to locate the method to perform your solution but have been unsuccessful. Therefore I have added one of my spreadsheets populated by the Power Automate.

Hopefully, you can help guide me on the process for the top row to have data entered each time rather than the bottom requiring scrolling to the bottom of the sheet each time. Unfortunately, my company laptop prohibits the XL2BB software; ill attach a snippet of my table.

Appreciate your knowledge share.

1647093574813.png
 
Upvote 0
"blad1" is the name of the sheet, D11:J11 is the headerrow, just above the range, you want to insert.
Then 2 ways of copying your new data
VBA Code:
Sub NewData()
     With Sheets("Blad1").Range("D11:J11")                      'this is the headerrow of your table (just above your 1st row of data)  -->Adapt to you situation
          .Offset(1).Insert                                     'insert cells the next line and shift them down
          With .Offset(1)                                       'in the new created empty row
               .Resize(, 3).Value = Array("value1", "value2", "value3")     '1st method of adding, 3 cells at once with a 1 dimensional array
               .Range("D1").Value = "value4"                    '2nd method of adding values, caution, D1 with that leading point means the 4th cell to the right of that startpoint
               .Range("E1").Value = "value5"
          End With
     End With
End Sub
 
Upvote 0
Fantastic, thank you for the prompt reply; I have run the code, but running process flow, the data does not seem to populate. Maybe power automation is conflicting with the code?
1647129981518.png
1647129995938.png
1647130187098.png
 
Upvote 0
in Array("value1", "value2", "value3"), you have to replace those "value1" by what it supposed to be.
if that first value is sheets("Sheet2").range("B5").value then it's like this
Array(sheets("Sheet2").range("B5").value, "value2", "value3")
but if you're not expirienced, perhaps better to add one at a time

Rich (BB code):
With .Offset(1)                                       'in the new created empty row
    .Range("A1").Value = sheets("Sheet2").range("B5").value       '2nd method of adding values
     .Range("B1").Value = sheets("Sheet2").range("B7").value
     .Range("C1").Value = sheets("Sheet2").range("B9").value
               ....
End With

that red point before "Range" is important !!! it refers to the previous "with"
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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