Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default same function edit vba excel

same function edit vba excel

Dim ws As Worksheet
Dim i As Long

'~~ Change this to the relevant sheet
Set ws = Sheet1

With ws
For i = 1 To 16
.Cells(i, "A").Value = .Cells(i, "E").Value
.Cells(i, "B").Value = .Cells(i, "F").Value
.Cells(i, "C").Value = .Cells(i, "G").Value
Next i
End With



I have VBA Excel as above.

in order to function like the code below what I need to change, yeah



Dim lastRowCount As Integer
totalRow = (Cells(Rows.Count, 1).End(xlUp).Row)
Dim DataRange As Variant
Dim i As Integer
Dim firstRowCount As Integer
firstRowCount = Target.Row
i = 0
DataRange = Sheets("Sheet1").Range("A" & firstRowCount & ":C" & firstRowCount).Value
For Each Item In DataRange


i = i + 1
Next
Dim jsonstring As String
jsonstring = "["& Code1 & Code2 & Code3& "]"



what I changed to be used
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default same function edit vba excel

thank you for the answer Claus Busch
https://i.imgur.com/wo2u67e.jpg
im trying red line
not moved right, is there a solution for that
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default same function edit vba excel

im try

Sub List1()
Dim ws As Worksheet
Dim i As Long
Dim LRow As Long

'~~ Change this to the relevant sheet
Set ws = Sheets("Sheet1")

With ws
LRow = .Cells(.Rows.Count, "E").End(xlUp).Row
For i = 1 To LRow
.Cells(i, "A").Cells(, 3).Value = _
.Cells(i, "E").Cells(, 3).Value
Next i
End With
End Sub
Sub List2()
Dim ws As Worksheet
Dim i As Long
Dim LRow As Long

'~~ Change this to the relevant sheet
Set ws = Sheets("Sheet1")

With ws
LRow = .Cells(.Rows.Count, "E").End(xlUp).Row
For i = 1 To LRow
.Cells(i, "B").Cells(, 1).Value = _
.Cells(i, "F").Cells(, 1).Value
Next i
End With
End Sub
Sub List3()
Dim ws As Worksheet
Dim i As Long
Dim LRow As Long

'~~ Change this to the relevant sheet
Set ws = Sheets("Sheet1")

With ws
LRow = .Cells(.Rows.Count, "E").End(xlUp).Row
For i = 1 To LRow
.Cells(i, "C").Cells(, 1).Value = _
.Cells(i, "G").Cells(, 1).Value
Next i
End With
End Sub

Sub callList()
Call List1
Call List2
Call List3
End Sub

and same with result

https://i.imgur.com/wo2u67e.jpg
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default same function edit vba excel

im try

Sub List1()
Dim ws As Worksheet
Dim i As Long
Dim LRow As Long

'~~ Change this to the relevant sheet
Set ws = Sheets("Sheet1")

With ws
LRow = .Cells(.Rows.Count, "E").End(xlUp).Row
For i = 1 To LRow
.Cells(i, "A").Cells(, 1).Value = _
.Cells(i, "E").Cells(, 1).Value
Next i
End With
End Sub


Sub List2()
Dim ws As Worksheet
Dim i As Long
Dim LRow As Long

'~~ Change this to the relevant sheet
Set ws = Sheets("Sheet1")

With ws
LRow = .Cells(.Rows.Count, "E").End(xlUp).Row
For i = 1 To LRow
.Cells(i, "B").Cells(, 1).Value = _
.Cells(i, "F").Cells(, 1).Value
Next i
End With
End Sub


Sub List3()
Dim ws As Worksheet
Dim i As Long
Dim LRow As Long

'~~ Change this to the relevant sheet
Set ws = Sheets("Sheet1")

With ws
LRow = .Cells(.Rows.Count, "E").End(xlUp).Row
For i = 1 To LRow
.Cells(i, "C").Cells(, 1).Value = _
.Cells(i, "G").Cells(, 1).Value
Next i
End With
End Sub

Sub callList()
Call List1
Call List2
Call List3
End Sub

and same with result

https://i.imgur.com/wo2u67e.jpg


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default same function edit vba excel

Hi,

Am Mon, 9 Mar 2020 01:44:08 -0700 (PDT) schrieb :


try:

Set ws = Sheets("Sheet1")

With ws
LRow = .Cells(1, "E").CurrentRegion.Rows.Count
For i = 1 To LRow
.Cells(i, "A").Resize(, 3).Value = _
.Cells(i, "E").Resize(, 3).Value
Next i
End With


Regards
Claus B.
--
Windows10
Office 2016
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default same function edit vba excel

ok, sip thanks and work
https://i.imgur.com/EwaULks.jpg
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default same function edit vba excel

can only fill in the last column of data that hasn't been filled yet,
No need to fill in the fields from the start.
only fill in data that doesn't yet exist

in vba same the above function,


now you fill in from beginning to end.
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
Edit Comment Function Bonita Excel Discussion (Misc queries) 3 January 12th 10 10:52 PM
Edit Function with Keyboard John M Excel Programming 1 January 14th 08 05:06 PM
Using "Find" function in Excel 2000, edit data without closing Fin rkgpihw Excel Discussion (Misc queries) 1 August 21st 06 07:39 PM
Why can't I edit my excel document? Edit buttons shaded. Arl @ CBC New Users to Excel 3 September 7th 05 01:18 AM


All times are GMT +1. The time now is 03:23 AM.

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"