Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Define Variable Name using VBA

I have a worksheet that I copy infor into. The information varies from paste
to paste. When I define a cell with a name, it can change from paste to
paste. I need to be able to find the required data "Original Amou" , then tab
to the next cell and define the cell as RegisteredAmountOwing. Then I ahve a
formula that captures the amount and creates a sentence such as "Amount owing
= $43,623.62".

Original Amou $43,623.62

Can someone help me with the code for defining the name each time I paste. i
already have the following code to find the name and tab to the cell:

Cells.Find(What:="original amou", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Cells.Find(What:="original amou", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Select

--
GTReferee
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Define Variable Name using VBA

set c = Cells.Find(What:="original amou", _
LookIn:=xlFormulas, LookAt:=xlPart)
set c = Cells.Find(What:="original amou", After:=c, _
LookIn:=xlFormulas, LookAt:=xlPart)

c.Offset(0, 1).Select


"GTReferee" wrote:

I have a worksheet that I copy infor into. The information varies from paste
to paste. When I define a cell with a name, it can change from paste to
paste. I need to be able to find the required data "Original Amou" , then tab
to the next cell and define the cell as RegisteredAmountOwing. Then I ahve a
formula that captures the amount and creates a sentence such as "Amount owing
= $43,623.62".

Original Amou $43,623.62

Can someone help me with the code for defining the name each time I paste. i
already have the following code to find the name and tab to the cell:

Cells.Find(What:="original amou", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Cells.Find(What:="original amou", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Select

--
GTReferee

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 313
Default Define Variable Name using VBA



Joel, the first part works great finding the cell. Now I be able to do a
Name/Define for that cell.

"Joel" wrote:

set c = Cells.Find(What:="original amou", _
LookIn:=xlFormulas, LookAt:=xlPart)
set c = Cells.Find(What:="original amou", After:=c, _
LookIn:=xlFormulas, LookAt:=xlPart)

c.Offset(0, 1).Select


"GTReferee" wrote:

I have a worksheet that I copy infor into. The information varies from paste
to paste. When I define a cell with a name, it can change from paste to
paste. I need to be able to find the required data "Original Amou" , then tab
to the next cell and define the cell as RegisteredAmountOwing. Then I ahve a
formula that captures the amount and creates a sentence such as "Amount owing
= $43,623.62".

Original Amou $43,623.62

Can someone help me with the code for defining the name each time I paste. i
already have the following code to find the name and tab to the cell:

Cells.Find(What:="original amou", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Cells.Find(What:="original amou", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Select

--
GTReferee

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Variable to Define Series Posse John Charts and Charting in Excel 2 August 30th 06 01:18 PM
How to take the worksheet name as a variable(Label/Define) in a fo Subin Excel Worksheet Functions 2 March 14th 06 12:43 PM
variable height variable width stacked bar charts ambthiru Charts and Charting in Excel 3 January 18th 06 11:41 PM
Define drop-down results that are variable and dependent upon the. 33zenlane Excel Discussion (Misc queries) 4 December 13th 05 09:42 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"