Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6071333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:02:07+00:00 2026-05-23T10:02:07+00:00

I am using excel 2010 and retrieving data from SQL analysis service. When I

  • 0

I am using excel 2010 and retrieving data from SQL analysis service.

When I refresh the data from excel , rows become dynamics as it is bind to external datasource. I am adding a seperate columns with formula for summing total amount.

With increment or decrement of rows in excel , alignment of custom columns goes out.

How can I resolve this problem that summing of values become dynamic with adding and removal of rows ?

How to write a macro for doing this task ?

This what i am trying , but i am getting the following error :

Public Sub ProcessData()
Dim i As Long
 Dim iLastRow As Long
Dim iStart As Long

With Sheet1

   iLastRow = .Cells(.Rows.Count, "D").End(xlUp).Row
 iStart = 5
  For i = 1 To iLastRow + 1
  If .Cells(i, "C").Value <> "" And .Cells(i, "B").Value <> "" Then
.Cells(i, "D").Value = 
 Application.Sum(.Range(.Cells(iStart, "C").Value + .Cells  (   iStart, "B").Value))
iStart = i + 1
End If
Next i
 End With
 End Sub

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:02:08+00:00Added an answer on May 23, 2026 at 10:02 am

    When you create a connection to a database (or other data source) formulas place in columns next to the imported data are adjusted on refresh to cope with this excat issue. These formulas will typically be in the form =SomeFunction([@ColumnName], ...)

    Likewise Sums of the form =SUM(ConnectionName[ColumnName]) will automatically be right when the connection is refreshed

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having been able to add data to an Excel spreadsheet from F# using the
I need to read from and write to Excel spreadsheets using Delphi 2010. Nothing
I am trying to strip data from thousands of identical Excel 2007/2010 files. I
I'm using VBA in Excel 2010 to make a simple birthday reminder program. I
I am using excel 2010. I am trying to create pivot table between two
Is there any way to query an excel 2010 spreadsheet, without using Jet or
Running Excel 2010 with PowerPivot 10.50.1747.0, accessing SQL Server 2005 SP2. I am modifying
I have get the date from excel sheet using POI using the below code,
Using NPOI and attempting to follow a tutorial here: http://www.zachhunter.com/2010/05/npoi-excel-template/ , I'm coming across
I'm using Excel 2010 and I have a macro that needs to load OData

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.