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

  • Home
  • SEARCH
  • 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 1075505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:16:55+00:00 2026-05-16T21:16:55+00:00

So today a received an excel spreadsheet with over 20,000 cells onto it. I

  • 0

So today a received an excel spreadsheet with over 20,000 cells onto it. I had to separate them by name (ever 14 rows starts a new client), and total the columns of prices. So, I wrote:

Sub NewSpace()
'
' NewSpace Macro
'
' Keyboard Shortcut: Ctrl+p
'
        'create the count variable, initilize it to 17
        Dim count As Integer
        count = 17

    While count <= 30003

            'add first row
            Rows(count & ":" & count).Select
            Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

            'add second row
            Rows(count & ":" & count).Select
            Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

            'Select cell A in the first created row, write "Total", and format properly
            Range("A" & count).Select
            ActiveCell.FormulaR1C1 = "Total"
            With ActiveCell.Characters(Start:=1, Length:=5).Font
                    .Name = "Calibri"
                    .FontStyle = "Bold"
                    .Size = 11
                    .Strikethrough = False
                    .Superscript = False
                    .Subscript = False
                    .OutlineFont = False
                    .Shadow = False
                    .Underline = xlUnderlineStyleNone
                    .ThemeColor = xlThemeColorLight1
                    .TintAndShade = 0
                    .ThemeFont = xlThemeFontMinor
            End With

            'Select cell H in the first created row, sum up the values
            Range("H" & count).Select
            ActiveCell.FormulaR1C1 = "=sum(H" & (count - 15) & ":H" & (count - 1) & ")"
            With ActiveCell.Characters(Start:=1, Length:=5).Font
                    .Name = "Calibri"
                    .FontStyle = "Bold"
                    .Size = 11
                    .Strikethrough = False
                    .Superscript = False
                    .Subscript = False
                    .OutlineFont = False
                    .Shadow = False
                    .Underline = xlUnderlineStyleNone
                    .ThemeColor = xlThemeColorLight1
                    .TintAndShade = 0
                    .ThemeFont = xlThemeFontMinor
            End With


    'increment the counter by 16, start again
    count = count + 16

    Wend
End Sub

However, I keep getting a #NAME error on this line:
ActiveCell.FormulaR1C1 = “=sum(H” & (count – 15) & “:H” & (count – 1) & “)”

Everything there looks fine to me, and honestly i’m not to sure what I have to change.

EDIT: I also forgot to mention, in the #NAME error, the formula shows correct, however it adds ‘ to the function, like so: =SUM(‘H__’:’H__’)

  • 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-16T21:16:56+00:00Added an answer on May 16, 2026 at 9:16 pm

    Try ActiveCell.Formula instead of ActiveCell.FormulaR1C1…

    .FormulaR1C1 is for different style of addressing cells

    ActiveCell.Formula = "=A1"
    

    and

    ActiveCell.FormulaR1C1 = "=R1C1"
    

    refers to the same cell.

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

Sidebar

Related Questions

Today I had a coworker suggest I refactor my code to use a label
Today I had a discussion with a colleague about nested functions in Javascript: function
I'm a developer on the Synergy+ project , and today we received our first
I received the following email today from a co-worker. My question is this accurate.
I just received some really great help today with a prior jQuery problem and
I received a ticket today concerning a broken application that was caused by a
I received a new computer at work today and for some reason all of
Today i received very unpleasant email about that one guy has got all my
Today i received an email from apple telling they are changing something connected with
Today I received of one of my app users a complaint about an error

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.