If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > change labels to formulas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-18-09, 13:59
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
change labels to formulas

I need to change all labels in my sheet to formulas,
so i want to change
Cell a1 value is Gross Revenue
to ="Gross Revenue"

this is what i tried but it didnt work:
Sub formulaFill()
Dim r As Range
Set r = ActiveSheet.UsedRange


Dim cell As Range
For Each cell In r.Cells
cell.Formula = "="" & cell.Value & """

Next


End Sub
Reply With Quote
  #2 (permalink)  
Old 03-20-09, 09:56
ludo27 ludo27 is offline
Registered User
 
Join Date: Feb 2009
Location: France
Posts: 6
Wink

Hello Mike,
this works :

Code:
Sub formulaFill()
Dim r As Range
Set r = ActiveSheet.UsedRange

Dim cell As Range
For Each cell In r.Cells
    cell.Formula = "=" & cell.Value
Next


End Sub
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Refbacks are On