There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Business Applications
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: sum two cells together


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
Zack Barresse's Avatar
Computer Specs
Distinguished Member with 3,302 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
08-May-2008, 12:54 PM #16
They're text. Try converting them...

Code:
    wk.Worksheets(MAIN_SHEET).Range("B6").Value = CLng(wk.Worksheets(DATA_SHEET).Range("BA3").Value) + CLng(wk.Worksheets(DATA_SHEET).Range("BB3").Value)
Works for me.
slurpee55's Avatar
Computer Specs
Distinguished Member with 3,843 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
08-May-2008, 01:01 PM #17
In 2003 it puts a little triangle in the corner to indicate that it is a number formatted as text and you just have to highlight all those cells and then click on the alert box to the side and it will convert them. Otherwise, if you click on the cell and then put your cursor into the formula bar at the top it will convert it to a number. But that is pretty time-consuming. Zack probably has a better way than that.
What version are you using?
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.

My theme song...
sk0101's Avatar
Senior Member with 139 posts.
 
Join Date: Nov 2007
08-May-2008, 01:09 PM #18
I am using Excel2007.
I tried Zack's formula and it worked!!!
Appreciate all of your help.
slurpee55's Avatar
Computer Specs
Distinguished Member with 3,843 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
08-May-2008, 01:13 PM #19
The CLng function converts it to long? Cool....
Zack Barresse's Avatar
Computer Specs
Distinguished Member with 3,302 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
08-May-2008, 02:16 PM #20
It is still seen as text when the Value is passed into memory via VBA, yes. Sucks, but it happens. You could populate a preset variable with the data as well without worrying about it ...

Code:
Sub populate()
    Dim wk As Workbook, wsDATA As Worksheet, r1 As Long, r2 As Long
    Set wk = ThisWorkbook
    Set wsDATA = wk.Sheets(DATA_SHEET)
    Let r1 = wsDATA.Range("BA3").Value
    Let r2 = wsDATA.Range("BB3").Value
    wk.Worksheets(MAIN_SHEET).Range("B6").Value = r1 + r2
    wk.Worksheets(MAIN_SHEET).Range("B11").Value = wsDATA.Range("B3").Value + wsDATA.Range("B4").Value
End Sub
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:56 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.