Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default help needed! how to clear my macro tabulate table

You want to clear G9:G13 in the Calculation worksheet, right?

I would think it would depend on what's in G9:G13. If it's just constants that
you fill in with macros, you could add:

worksheets("Calculation").range("G9:g13").clearcon tents

If that range contains formulas, I think you'll have to revise your formulas to
depend on something else (I don't have a guess what that would be).

If the g9:g13 contains both, you'll need a little of both.


Oligo wrote:

Sub MakeATable()
Dim myB2Arr As Range
Dim myB4Arr As Range
Dim myB2 As Range
Dim myB4 As Range
Dim myR As Long

Set myB2Arr = Worksheets("Main Data").Range("A10:A13")
Set myB4Arr = Worksheets("Main Data").Range("A3:A5")

For Each myB2 In myB2Arr
For Each myB4 In myB4Arr

Worksheets("calculation").Range("B2").Value = myB2.Value
Worksheets("calculation").Range("B4").Value = myB4.Value

Application.CalculateFull

myR = Cells(Rows.Count, 1).End(xlUp)(2).Row
Cells(myR, 1).Value = myB2.Value
Cells(myR, 2).Value = myB4.Value
Worksheets("calculation").Range("G9:G13").Copy
Cells(myR, 3).PasteSpecial xlValues, Transpose:=True

Next myB4
Next myB2
End Sub

i have this code currently that tabulate a table on a new sheet. currently
i added a play button to run the macro.
my output G9:G13 is dependent on other inputs cells. my question is how do i
clear the previous table for a next set of input change tabulation? ie. i
only want my table to show current data and not build on from past output.


--

Dave Peterson
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default help needed! how to clear my macro tabulate table

actually i just want to clear the tabulated table on the active sheet which
just contain the tabulated table. so i just have .clearcontent.

but my problems now is how to keep the decimal places of the cells and
conditional formating(added the data bar color formatting) after i
clearcontent ??

"Dave Peterson" wrote:

You want to clear G9:G13 in the Calculation worksheet, right?

I would think it would depend on what's in G9:G13. If it's just constants that
you fill in with macros, you could add:

worksheets("Calculation").range("G9:g13").clearcon tents

If that range contains formulas, I think you'll have to revise your formulas to
depend on something else (I don't have a guess what that would be).

If the g9:g13 contains both, you'll need a little of both.


Oligo wrote:

Sub MakeATable()
Dim myB2Arr As Range
Dim myB4Arr As Range
Dim myB2 As Range
Dim myB4 As Range
Dim myR As Long

Set myB2Arr = Worksheets("Main Data").Range("A10:A13")
Set myB4Arr = Worksheets("Main Data").Range("A3:A5")

For Each myB2 In myB2Arr
For Each myB4 In myB4Arr

Worksheets("calculation").Range("B2").Value = myB2.Value
Worksheets("calculation").Range("B4").Value = myB4.Value

Application.CalculateFull

myR = Cells(Rows.Count, 1).End(xlUp)(2).Row
Cells(myR, 1).Value = myB2.Value
Cells(myR, 2).Value = myB4.Value
Worksheets("calculation").Range("G9:G13").Copy
Cells(myR, 3).PasteSpecial xlValues, Transpose:=True

Next myB4
Next myB2
End Sub

i have this code currently that tabulate a table on a new sheet. currently
i added a play button to run the macro.
my output G9:G13 is dependent on other inputs cells. my question is how do i
clear the previous table for a next set of input change tabulation? ie. i
only want my table to show current data and not build on from past output.


--

Dave Peterson

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
Macro to clear contents and put an X bevchapman Excel Discussion (Misc queries) 3 March 17th 09 07:03 PM
Macro to clear checkboxes Guy[_2_] Excel Worksheet Functions 5 January 2nd 09 08:39 PM
clear cells macro Dorothy Excel Discussion (Misc queries) 5 April 7th 08 12:46 AM
Clear shhet with macro Micos3 Excel Discussion (Misc queries) 2 February 20th 06 05:50 PM
Clear Contents Macro SJC Excel Worksheet Functions 3 October 27th 05 07:26 PM


All times are GMT +1. The time now is 01:11 PM.

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

About Us

"It's about Microsoft Excel"