How to copy a formula horizontally within a table using Excel VBA

0 votes
I'm trying to write a macro to add an extra column to each table, and simultaneously copy over the formula from the previous column. The adding of a new column is going great, but the copying-over is causing me problems.
Feb 15, 2022 in Others by Edureka
• 13,690 points
1,085 views

2 answers to this question.

0 votes

Excel has an option to sort the data horizontally using the Sort dialog box (the ‘Sort left to right’ feature).

  1. In the row below, enter ‘Helper’ as the heading for the row
  2. In the helper row, enter a series of numbers (1,2,3, and so on).
  3. Select the entire data set including the helper row
  4. Click the Data tab
  5. Click on the Sort icon
  6. In the Sort dialog box, click on the Options button.
  7. In the dialog box that opens, click on ‘Sort left to right'
  8. Press OK,In the Sort by drop-down, select Row 3 (or whatever row has your helper column)
  9. In the Order drop-down, select ‘Largest to Smallest’. Press OK
  10. The above steps will Flip the table horizontally and u can remove the helper row
answered Feb 16, 2022 by gaurav
• 23,260 points
0 votes
Hi so basically, create an adjacent column and name it 'Header' and add a series number (1,2,3,4 and so on )

Now select the entire data set along with the helper column. You can see a Data tab in the excel sheet. Select that
Select the sort icon. After you select that, select ‘Helper’ in the ‘Sort by’ dropdown
When you select that, in the drop-down select ' Largest to smallest '
and then Select OK
 

After this, your question will be sorted
answered Feb 16, 2022 by Edureka
• 13,690 points

Related Questions In Others

0 votes
1 answer

Is there a way to test a formula result in excel and type it only once, all within one cell and not using a user defined function?

Use the Let function: =LET(Value,A1+B2+C4+G3+B4,IF(Value>10,"No",Value)) I hope this helps ...READ MORE

answered Jan 9, 2023 in Others by narikkadan
• 63,600 points
681 views
0 votes
1 answer

Converting Textboxes Link and/or Formula to Values in a Copied Sheet using Excel VBA

Copy the values using Range and Value2 With ActiveSheet.UsedRange ...READ MORE

answered Jan 31, 2023 in Others by narikkadan
• 63,600 points
610 views
0 votes
1 answer
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,257 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,695 views
0 votes
1 answer

Language independent way to get "My Documents" folder in VBA Excel 2003

 Hello :)  This code may help you in your ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
829 views
0 votes
0 answers

Excel: Highlighting duplicates with exact matches

1 I've got two columns of data, and ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,690 points
472 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
965 views
0 votes
1 answer

How to import data from a HTML table on a website to excel?

Hello  To import any HTML file in excel there ...READ MORE

answered Feb 10, 2022 in Others by gaurav
• 23,260 points
7,969 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP