help with dataform and sorting macros
When working on the dataform macro, I get an error -
debugging message - when I run this at the line:
Set myRng = Worksheets("sheet1").Range("a:g")
Any suggestions?
Thanks,
Beth
-----Original Message-----
If you name your range, excel will look there to find
your database:
Option Explicit
Sub testme()
Dim myRng As Range
Set myRng = Worksheets("sheet1").Range("a:g")
myRng.Name = "database"
Worksheets("sheet1").ShowDataForm
End Sub
In your auto_close, maybe you could sort your data with
headers:=xlno. (just
start with the real data--row 2???).
with worksheets("sheet1")
.range("a2:g" & .cells(.rows.count,"A").end
(xlup).row).sort .....
end with
I used the last cell in column A to find the end of
data. And I only sorted
through G. Fix both of those to match your data.)
Beth Mc wrote:
I created a dataform macro in Excel with the Auto_Open
name. I need the dataform to be for just the headings in
columns A-G, although there are column headings in A-P,
H-
P aren't needed for the average data entry person. Does
anyone have any suggestions?
I also need to have a column G sort ascending upon
close,
Auto_Close macro. I got it started, but since Row 1 is a
merged cell, and isn't included in the macro, I keep
getting a debugging error. Need to sort G2--end of data.
Any suggestions?
I can provide copies of the macro wording that I tried
to
use if you need to see it.
Thanks!
Beth
--
Dave Peterson
.
|