editing macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Below is a macro I have set up. I am trying to paste information into the excel spread sheet from an internet page. The first time I click into A1 and paste, run the Macro to edit, then click into B1, Paste, Run the edit etc. Because I created this when I made the C1 column, it keeps over writing in C1. How can I change this so that it edits where the cursor is, or at least goes to D1, then E1, etc. I see the range at the bottom also says D1, so that will need to be addressed

Selection.TextToColumns Destination:=Range("C1"), DataType:=xlFixedWidth,
FieldInfo:=Array(Array(0, 1), Array(18, 1)
Columns("C:C").Selec
Selection.Delete Shift:=xlToLef
With Selectio
.HorizontalAlignment = xlLef
.VerticalAlignment = xlBotto
.WrapText = Fals
.Orientation =
.IndentLevel =
.ShrinkToFit = Fals
.MergeCells = Fals
End Wit
ActiveWorkbook.Sav
Selection.ColumnWidth = 30.4
Range("D1").Selec
End Su
 
Cindy,

Here is a start. I took the column delete out as it seemed unwise, and I
also took out the last select, leave that to user action.

You might want to take-out the workbook save on each edit,. and do it at the
end.

With ActiveCell
.TextToColumns Destination:=ActiveCell, _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(18, 1))
End With
With ActiveCell
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
.ColumnWidth = 30.43
End With
ActiveWorkbook.Save

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Cindy K said:
Below is a macro I have set up. I am trying to paste information into the
excel spread sheet from an internet page. The first time I click into A1
and paste, run the Macro to edit, then click into B1, Paste, Run the edit
etc. Because I created this when I made the C1 column, it keeps over
writing in C1. How can I change this so that it edits where the cursor is,
or at least goes to D1, then E1, etc. I see the range at the bottom also
says D1, so that will need to be addressed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top