Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Making condition dynamic?


I have a macro made for a spreadsheet. It used to work, until I began
adding new rows. Since the macro was told to select, say, A1:A20, and
now i have an extra row, that row will not be selected. Is there any
way to make this condition A1:A'X', leaving X a variable, hence
allowing the macro to work with any number of rows?


--
aposatsk
------------------------------------------------------------------------
aposatsk's Profile: http://www.excelforum.com/member.php...o&userid=36709
View this thread: http://www.excelforum.com/showthread...hreadid=571762

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,090
Default Making condition dynamic?

There are a number of ways of doing this. Which way fits you depends on the
layout of your data. What would you say to a person if you were telling him
how to determine what rows to select? Post your code when you respond. Not
the file. Just the pertinent code. HTH Otto
"aposatsk" wrote in
message ...

I have a macro made for a spreadsheet. It used to work, until I began
adding new rows. Since the macro was told to select, say, A1:A20, and
now i have an extra row, that row will not be selected. Is there any
way to make this condition A1:A'X', leaving X a variable, hence
allowing the macro to work with any number of rows?


--
aposatsk
------------------------------------------------------------------------
aposatsk's Profile:
http://www.excelforum.com/member.php...o&userid=36709
View this thread: http://www.excelforum.com/showthread...hreadid=571762



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Making condition dynamic?


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 15/05/2006 by Alex_Posatskiy
'

'
* Range("X9:AD127").Select
Range("X9:AF127").Select*
Range("AF9").Activate
Selection.Copy
Range("W9").Select
ActiveSheet.Paste
*Range("AF9:AF127").Select*
Selection.ClearContents
Range("W4").Select
With Worksheets("Asphalt").Range("w7")
.Value = .Value + 7
End With
End Sub

The "127" has changed and will constantly change. I want the code to
leave the "127" variable to the length of the chart.




Otto Moehrbach Wrote:
There are a number of ways of doing this. Which way fits you depends on
the
layout of your data. What would you say to a person if you were
telling him
how to determine what rows to select? Post your code when you respond.
Not
the file. Just the pertinent code. HTH Otto
"aposatsk"
wrote in
message ...

I have a macro made for a spreadsheet. It used to work, until I

began
adding new rows. Since the macro was told to select, say, A1:A20,

and
now i have an extra row, that row will not be selected. Is there any
way to make this condition A1:A'X', leaving X a variable, hence
allowing the macro to work with any number of rows?


--
aposatsk

------------------------------------------------------------------------
aposatsk's Profile:
http://www.excelforum.com/member.php...o&userid=36709
View this thread:

http://www.excelforum.com/showthread...hreadid=571762



--
aposatsk
------------------------------------------------------------------------
aposatsk's Profile: http://www.excelforum.com/member.php...o&userid=36709
View this thread: http://www.excelforum.com/showthread...hreadid=571762

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Making condition dynamic?


Anyone?
-------


--
aposatsk
------------------------------------------------------------------------
aposatsk's Profile: http://www.excelforum.com/member.php...o&userid=36709
View this thread: http://www.excelforum.com/showthread...hreadid=571762

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
Making a dynamic list?! mayerc Excel Discussion (Misc queries) 2 June 15th 06 03:47 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Making path of linked cell dynamic Negentropy Excel Discussion (Misc queries) 3 September 24th 05 09:02 PM
dynamic charts Dave Breitenbach Charts and Charting in Excel 5 July 1st 05 05:49 AM
Can't create dynamic charts Brian Sells Charts and Charting in Excel 7 March 22nd 05 04:23 AM


All times are GMT +1. The time now is 03:22 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"